build: check before removing %config% link

PR-URL: https://github.com/nodejs/node/pull/51437
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
This commit is contained in:
liudonghua authored and Michaël Zasso committed 2024-02-15 12:05:52 +01:00
1 parent cc37959232
commit 85f63f3d7d
1 file changed
+2 -1
+2 -1
View File
@@ -337,7 +337,8 @@ if errorlevel 1 (
if "%target%" == "Clean" goto exit
:after-build
rd %config%
:: Check existence of %config% before removing it.
if exist %config% rd %config%
if errorlevel 1 echo "Old build output exists at 'out\%config%'. Please remove." & exit /B
:: Use /J because /D (symlink) requires special permissions.
if EXIST out\%config% mklink /J %config% out\%config%