aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-28 14:12:10 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-28 14:12:10 +0900
commit6589af52d22e1b5976295adc7968c55218d5b168 (patch)
treeafbb605e126ae4b1d0f069d1e0e170a2f1f6d212 /tool
parent7e6204dd10857a6f1fb72119082ff7797686c089 (diff)
downloadruby-6589af52d22e1b5976295adc7968c55218d5b168.tar.gz
Print the date to STDERR if STDIN is a part of input [ci skip]
Diffstat (limited to 'tool')
-rwxr-xr-xtool/update-bundled_gems.rb5
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])