From b9a427976b11129f9410abdd275505724d9dac64 Mon Sep 17 00:00:00 2001 From: liudonghua Date: Fri, 26 Jan 2024 04:46:09 +0800 Subject: [PATCH] build: check before removing %config% link MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit PR-URL: https://github.com/nodejs/node/pull/51437 Reviewed-By: Vinícius Lourenço Claro Cardoso Reviewed-By: Tobias Nießen Reviewed-By: Luigi Pinca --- vcbuild.bat | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vcbuild.bat b/vcbuild.bat index d093138b31c6a4..c3852c89cc5e18 100644 --- a/vcbuild.bat +++ b/vcbuild.bat @@ -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%