зеркало из https://github.com/github/ruby.git
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:
Родитель
8565a1b502
Коммит
d7144025fd
|
@ -2,6 +2,7 @@
|
|||
:: usage: ifchange target temporary
|
||||
|
||||
set timestamp=
|
||||
set keepsuffix=
|
||||
:optloop
|
||||
for %%I in (%1) do set opt=%%~I
|
||||
if "%opt%" == "--timestamp" (
|
||||
|
@ -12,6 +13,14 @@ if "%opt%" == "--timestamp" (
|
|||
set timestamp=%opt:~12%
|
||||
shift
|
||||
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
|
||||
|
||||
|
@ -51,6 +60,7 @@ echo assuming %1 should be changed.
|
|||
echo %1 updated.
|
||||
:: if exist %1 del %1
|
||||
dir /b %2
|
||||
if "%keepsuffix%" != "" %1 %1%keepsuffix%
|
||||
copy %2 %1
|
||||
del %2
|
||||
goto :end
|
||||
|
|
Загрузка…
Ссылка в новой задаче