Skip to content
This repository has been archived by the owner on Aug 8, 2024. It is now read-only.

Commit

Permalink
Fix clean.cmd with no args (dotnet#25158)
Browse files Browse the repository at this point in the history
Also just copy over coreclr's clean.cmd to make it identical.
  • Loading branch information
mmitche authored Nov 9, 2017
1 parent 46e84b8 commit d40e166
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions clean.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,17 @@
setlocal EnableDelayedExpansion

set NO_DASHES_ARG=%1
if not defined NO_DASHES_ARG goto no_help
if /I [%NO_DASHES_ARG:-=%] == [?] goto Usage
if /I [%NO_DASHES_ARG:-=%] == [h] goto Usage

:no_help
:: Check if VBCSCompiler.exe is running
tasklist /fi "imagename eq VBCSCompiler.exe" |find ":" > nul
:: Compiler is running if errorlevel == 1
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
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
)

:: Strip all dashes off the argument and use invariant
Expand All @@ -30,14 +32,13 @@ exit /b %ERRORLEVEL%

:Usage
echo.
echo Usage: clean [-b] [-p] [-c] [-all]
echo Repository cleaning script.
echo.
echo Options:
echo -b - Deletes the binary output directory.
echo -p - Deletes the repo-local nuget package directory.
echo -c - Deletes the user-local nuget package cache.
echo -all - Combines all of the above.
echo -b - Delete the binary output directory.
echo -p - Delete the repo-local NuGet package directory.
echo -c - Deletes the user-local NuGet package cache.
echo -all - Cleans repository and restores it to pristine state.
echo.
echo If no option is specified then clean.cmd -b is implied.

exit /b 1
echo ^If no option is specified then "clean -b" is implied.
exit /b

0 comments on commit d40e166

Please sign in to comment.