forked from microsoft/vcpkg
-
Notifications
You must be signed in to change notification settings - Fork 0
/
clean.bat
45 lines (40 loc) · 836 Bytes
/
clean.bat
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
@echo off
setlocal enableextensions
call :GetBatchFileDirectory _MyDir
for %%a in (
"bt"
"buildtrees"
"downloads"
"installed"
"packages"
) do (
if exist "%_MyDir%\%%~a\." (
echo Deleting %%~a directory.
rmdir /q /s "%_MyDir%\%%~a"
)
)
if exist "%_MyDir%\vcpkg.exe" (
del /q "%_MyDir%\vcpkg.exe"
)
endlocal
goto :EOF
::
:: GetBatchFileDirectory
::
:: Gets the name of the directory in which the batch file is located. The directory name will not
:: have a final trailing \ character.
::
:: The directory name is stored in the environment variable specified by the first parameter of the
:: function.
::
:GetBatchFileDirectory
set _dir=%~dp0
set _dir=%_dir:~0,-1%
if "%_dir%" EQU "" (
set _dir=
exit /b 1
)
set %1=%_dir%
set _dir=
exit /b 0
goto :EOF