1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00
ruby--ruby/win32/rm.bat
NAKAMURA Usaku 7bd7a013b1
Fix $(RMALL) -r on Windows
`set recursive=1 &` sets `1 ` to `recursive`, not `1`.
2019-11-26 11:44:11 +09:00

18 lines
382 B
Batchfile
Executable file

@echo off
:optloop
if "%1" == "-f" shift
if "%1" == "-r" (shift & set "recursive=1" & goto :optloop)
if "%recursive%" == "1" goto :recursive
:begin
if "%1" == "" goto :end
set p=%1
if exist "%p:/=\%" for %%I in ("%p:/=\%") do @del "%%I"
shift
goto :begin
:recursive
if "%1" == "" goto :end
set p=%1
if exist "%p:/=\%" rd /s /q "%p:/=\%"
shift
goto :recursive
:end