[前][次][番号順一覧][スレッド一覧]

ruby-changes:31230

From: nobu <ko1@a...>
Date: Wed, 16 Oct 2013 23:39:56 +0900 (JST)
Subject: [ruby-changes:31230] nobu:r43309 (trunk): ifchange.bat: --keep option

nobu	2013-10-16 23:39:53 +0900 (Wed, 16 Oct 2013)

  New Revision: 43309

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=43309

  Log:
    ifchange.bat: --keep option
    
    * win32/ifchange.bat: add --keep option as well as tool/ifchange.

  Modified files:
    trunk/win32/ifchange.bat
Index: win32/ifchange.bat
===================================================================
--- win32/ifchange.bat	(revision 43308)
+++ win32/ifchange.bat	(revision 43309)
@@ -2,6 +2,7 @@ https://github.com/ruby/ruby/blob/trunk/win32/ifchange.bat#L2
 :: 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" ( https://github.com/ruby/ruby/blob/trunk/win32/ifchange.bat#L13
     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. https://github.com/ruby/ruby/blob/trunk/win32/ifchange.bat#L60
 echo %1 updated.
 :: if exist %1 del %1
 dir /b %2
+if "%keepsuffix%" != "" %1 %1%keepsuffix%
 copy %2 %1
 del %2
 goto :end

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]