Allow clean.bat to be run from anywhere
authorAndrew Dunstan <[email protected]>
Thu, 20 Jan 2022 15:13:18 +0000 (10:13 -0500)
committerAndrew Dunstan <[email protected]>
Thu, 20 Jan 2022 15:21:28 +0000 (10:21 -0500)
This was omitted from c3879a7b4c which modified the other msvc .bat
files.

Per request from Juan José Santamaría Flecha

Discussion: https://postgr.es/m/CAC+AXB0_fxYGbQoaYjCA8um7TTbOVP4L9aXnVmHwK8WzaT4gdA@mail.gmail.com

Backpatch to all live branches.

src/tools/msvc/clean.bat

index 0a88b5253604d1b5c90d9b5862a7d7ff924814bf..c75061b280d95aea59249f349e4a28f2b78aa202 100755 (executable)
@@ -4,8 +4,9 @@ REM src/tools/msvc/clean.bat
 set DIST=0
 if "%1"=="dist" set DIST=1
 
-set D=%CD%
-if exist ..\msvc if exist ..\..\..\src cd ..\..\..
+setlocal
+
+cd "%~dp0\..\..\.."
 
 if exist debug rd /s /q debug
 if exist release rd /s /q release
@@ -130,7 +131,7 @@ REM Clean up datafiles built with contrib
 REM cd contrib
 REM for /r %%f in (*.sql) do if exist %%f.in del %%f
 
-cd %D%
+cd "%~dp0"
 
 REM Clean up ecpg regression test files
 msbuild ecpg_regression.proj /NoLogo /v:q %MSBFLAGS% /t:clean