1 @if not defined __echo @echo off
2 setlocal EnableDelayedExpansion
18 if [%1]==[] goto Begin
20 if /I [%1] == [-?] goto Usage
21 if /I [%1] == [-help] goto Usage
25 set thisArgs=!thisArgs!%1
31 set thisArgs=!thisArgs!%1
37 set thisArgs=!thisArgs!%1
41 if /I [%1] == [-all] (
53 :: Set __ProjectDir to be the directory of this script
54 set "__ProjectDir=%~dp0"
55 :: remove trailing slash
56 if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
57 set "__RootBinDir=%__ProjectDir%\bin"
59 if [%bin%] == [true] (
60 if exist "%__RootBinDir%" (
61 echo Deleting bin directory
62 rd /s /q "%__RootBinDir%"
63 if NOT [!ERRORLEVEL!]==[0] (
64 echo ERROR: An error occurred while deleting the bin directory - error code is !ERRORLEVEL!
70 if [%tools%] == [true] (
71 if exist "%__ProjectDir%\Tools" (
72 echo Deleting tools directory
73 rd /s /q "%__ProjectDir%\Tools"
74 if NOT [!ERRORLEVEL!]==[0] (
75 echo ERROR: An error occurred while deleting the Tools directory - error code is !ERRORLEVEL!
81 if [%packages%] == [true] (
82 if exist "%__ProjectDir%\packages" (
83 echo Deleting packages directory
84 rd /s /q "%__ProjectDir%\packages"
85 if NOT [!ERRORLEVEL!]==[0] (
86 echo ERROR: An error occurred while deleting the packages directory - error code is !ERRORLEVEL!
92 echo Clean was successful
97 echo Repository cleaning script.
99 echo -b - Cleans the bin directory
100 echo -p - Cleans the packages directory
101 echo -t - Cleans the tools directory
102 echo -all - Cleans everything
104 echo If no option is specified then clean.cmd -b -p -t is implied.