summaryrefslogtreecommitdiff
path: root/src/tools
diff options
context:
space:
mode:
authorAndrew Dunstan2022-01-20 15:13:18 +0000
committerAndrew Dunstan2022-01-20 15:21:12 +0000
commit0a79feeca718f6934f57672ae4a5846f3da3d159 (patch)
tree0dea219a657aae7a9935f757fcb5f1110df612a0 /src/tools
parent44ab2dac12a752022eb4fe3dba7beddbc3433a0e (diff)
Allow clean.bat to be run from anywhere
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.
Diffstat (limited to 'src/tools')
-rwxr-xr-xsrc/tools/msvc/clean.bat7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/tools/msvc/clean.bat b/src/tools/msvc/clean.bat
index 1d9cd40bdb1..5beb7d228b1 100755
--- a/src/tools/msvc/clean.bat
+++ b/src/tools/msvc/clean.bat
@@ -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
@@ -128,7 +129,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