summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacek Blaszczynski <biosciencenow@outlook.com>2017-11-06 17:49:59 +0100
committerJacek Blaszczynski <biosciencenow@outlook.com>2017-11-06 17:49:59 +0100
commit4148d6abf1a4ea3c98431fa99cb9a02baabb1b98 (patch)
tree6d0de9ad1c53eae24335a1f6e7511686b7f99f06
parent4be1b4b90f17418e5784a269cc5214efe24a5afa (diff)
downloadcoreclr-4148d6abf1a4ea3c98431fa99cb9a02baabb1b98.tar.gz
coreclr-4148d6abf1a4ea3c98431fa99cb9a02baabb1b98.tar.bz2
coreclr-4148d6abf1a4ea3c98431fa99cb9a02baabb1b98.zip
Improve clean.cmd by adding VBCScompiler.exe kill logic and git clean -xdf cleanup
-rw-r--r--clean.cmd17
1 files changed, 16 insertions, 1 deletions
diff --git a/clean.cmd b/clean.cmd
index 42b9e59991..84d897eb11 100644
--- a/clean.cmd
+++ b/clean.cmd
@@ -11,6 +11,7 @@ if [%1]==[] (
set bin=true
set packages=true
set tools=true
+ set all=false
goto Begin
)
@@ -42,6 +43,7 @@ if /I [%1] == [-all] (
set tools=true
set bin=true
set packages=true
+ set all=true
goto Begin
)
@@ -56,6 +58,13 @@ set "__ProjectDir=%~dp0"
if %__ProjectDir:~-1%==\ set "__ProjectDir=%__ProjectDir:~0,-1%"
set "__RootBinDir=%__ProjectDir%\bin"
+:: Check if VBCSCompiler.exe is running and stop it
+tasklist /fi "imagename eq VBCSCompiler.exe" |find ":" > nul
+if errorlevel 1 (
+ echo Stop VBCSCompiler.exe execution.
+ for /f "tokens=2 delims=," %%F in ('tasklist /nh /fi "imagename eq VBCSCompiler.exe" /fo csv') do taskkill /f /PID %%~F
+)
+
if [%bin%] == [true] (
if exist "%__RootBinDir%" (
echo Deleting bin directory
@@ -89,6 +98,12 @@ if [%packages%] == [true] (
)
)
+if [%all%] == [true] (
+ echo Cleaning entire working directory ...
+ call git clean -xdf
+ exit /b !ERRORLEVEL!
+)
+
echo Clean was successful
exit /b 0
@@ -99,7 +114,7 @@ echo Options:
echo -b - Cleans the bin directory
echo -p - Cleans the packages directory
echo -t - Cleans the tools directory
-echo -all - Cleans everything
+echo -all - Cleans everything and restores repository to pristine state
echo.
echo If no option is specified then clean.cmd -b -p -t is implied.
exit /b \ No newline at end of file