From 6589af52d22e1b5976295adc7968c55218d5b168 Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Sat, 28 Oct 2023 14:12:10 +0900 Subject: Print the date to STDERR if STDIN is a part of input [ci skip] --- tool/update-bundled_gems.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'tool') 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]) -- cgit v1.2.3