mirror of
https://github.com/ruby/ruby.git
synced 2026-08-03 11:18:06 +08:00
Win32: Append -p option to RMDIRS
`rmdirs.bat` may require this option explicitly to remove parent directories, in the future.
This commit is contained in:
parent
a6c5d290ab
commit
fa51388641
Notes:
git
2025-12-02 00:56:05 +00:00
@ -117,7 +117,7 @@ IFCHANGE = $(COMSPEC) /C $(srcdir:/=\)\win32\ifchange.bat
|
||||
RM = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat
|
||||
RM1 = del
|
||||
RMDIR = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
|
||||
RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat
|
||||
RMDIRS = $(COMSPEC) /C $(srcdir:/=\)\win32\rmdirs.bat -p
|
||||
RMALL = $(COMSPEC) /C $(srcdir:/=\)\win32\rm.bat -f -r
|
||||
MAKEDIRS = $(COMSPEC) /E:ON /C $(srcdir:/=\)\win32\makedirs.bat
|
||||
TOUCH = $(BASERUBY) -run -e touch --
|
||||
@ -968,7 +968,7 @@ s,@LN_S@,$(LN_S),;t t
|
||||
s,@SET_MAKE@,MFLAGS = -$$(MAKEFLAGS),;t t
|
||||
s,@RM@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat,;t t
|
||||
s,@RMDIR@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,:t t
|
||||
s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat,;t t
|
||||
s,@RMDIRS@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rmdirs.bat -p,;t t
|
||||
s,@RMALL@,$$(COMSPEC) /C $$(top_srcdir:/=\)\win32\rm.bat -f -r,:t t
|
||||
s,@MAKEDIRS@,$$(COMSPEC) /E:ON /C $$(top_srcdir:/=\)\win32\makedirs.bat,;t t
|
||||
s,@LIBOBJS@,$(LIBOBJS),;t t
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
@echo off
|
||||
@setlocal EnableExtensions DisableDelayedExpansion || exit /b -1
|
||||
if "%1" == "-p" shift
|
||||
set parents=1
|
||||
:optloop
|
||||
if "%1" == "--debug" (shift & set PROMPT=$E[34m+$E[m$S & echo on & goto :optloop)
|
||||
if "%1" == "-p" (shift & (set parents=1) & goto :optloop)
|
||||
:begin
|
||||
if "%1" == "" goto :end
|
||||
set dir=%1
|
||||
@ -12,6 +15,7 @@ if "%1" == "" goto :end
|
||||
if "%dir%" == "." goto :begin
|
||||
if "%dir%" == ".." goto :begin
|
||||
rd "%dir%" 2> nul || goto :begin
|
||||
if "%parents%" == "" goto :begin
|
||||
:trim_sep
|
||||
if not /%dir:~-1%/ == /\/ goto :trim_base
|
||||
set dir=%dir:~0,-1%
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user