mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
ifchange.bat: --keep option
* win32/ifchange.bat: add --keep option as well as tool/ifchange. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43309 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
8565a1b502
commit
d7144025fd
1 changed files with 10 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
||||||
:: usage: ifchange target temporary
|
:: usage: ifchange target temporary
|
||||||
|
|
||||||
set timestamp=
|
set timestamp=
|
||||||
|
set keepsuffix=
|
||||||
:optloop
|
:optloop
|
||||||
for %%I in (%1) do set opt=%%~I
|
for %%I in (%1) do set opt=%%~I
|
||||||
if "%opt%" == "--timestamp" (
|
if "%opt%" == "--timestamp" (
|
||||||
|
@ -12,6 +13,14 @@ if "%opt%" == "--timestamp" (
|
||||||
set timestamp=%opt:~12%
|
set timestamp=%opt:~12%
|
||||||
shift
|
shift
|
||||||
goto :optloop
|
goto :optloop
|
||||||
|
) else if "%opt%" == "--keep" (
|
||||||
|
set keepsuffix=.old
|
||||||
|
shift
|
||||||
|
goto :optloop
|
||||||
|
) else if "%opt:~0,7%" == "--keep=" (
|
||||||
|
set keepsuffix=%opt:~7%
|
||||||
|
shift
|
||||||
|
goto :optloop
|
||||||
)
|
)
|
||||||
if "%opt%" == "" goto :end
|
if "%opt%" == "" goto :end
|
||||||
|
|
||||||
|
@ -51,6 +60,7 @@ echo assuming %1 should be changed.
|
||||||
echo %1 updated.
|
echo %1 updated.
|
||||||
:: if exist %1 del %1
|
:: if exist %1 del %1
|
||||||
dir /b %2
|
dir /b %2
|
||||||
|
if "%keepsuffix%" != "" %1 %1%keepsuffix%
|
||||||
copy %2 %1
|
copy %2 %1
|
||||||
del %2
|
del %2
|
||||||
goto :end
|
goto :end
|
||||||
|
|
Loading…
Reference in a new issue