diff options
author | Nobuyoshi Nakada <[email protected]> | 2023-10-28 14:12:10 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <[email protected]> | 2023-10-28 14:12:10 +0900 |
commit | 6589af52d22e1b5976295adc7968c55218d5b168 (patch) | |
tree | afbb605e126ae4b1d0f069d1e0e170a2f1f6d212 | |
parent | 7e6204dd10857a6f1fb72119082ff7797686c089 (diff) |
Print the date to STDERR if STDIN is a part of input [ci skip]
-rwxr-xr-x | tool/update-bundled_gems.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb index 2f088804ef..f27ba98961 100755 --- a/tool/update-bundled_gems.rb +++ b/tool/update-bundled_gems.rb @@ -2,10 +2,11 @@ BEGIN { require 'rubygems' date = nil -} -END { # STDOUT is not usable in inplace edit mode output = $-i ? STDOUT : STDERR +} +output = STDERR if ARGF.file == STDIN +END { output.print date.strftime("latest_date=%F") if date } unless /^[^#]/ !~ (gem = $F[0]) |