aboutsummaryrefslogtreecommitdiffstats
path: root/tool
diff options
context:
space:
mode:
authorNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-27 16:57:21 +0900
committerNobuyoshi Nakada <nobu@ruby-lang.org>2023-10-27 16:57:21 +0900
commit934beac1182814ec785baab2a84e886f5f2859b2 (patch)
tree8ccc5ba906103f458275a50debead7160115b4de /tool
parentbba94659345acda0a0269321083181166300e899 (diff)
downloadruby-934beac1182814ec785baab2a84e886f5f2859b2.tar.gz
Select the destination for the latest date by whether inplace mode
Diffstat (limited to 'tool')
-rwxr-xr-xtool/update-bundled_gems.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb
index 6b40595960..2f088804ef 100755
--- a/tool/update-bundled_gems.rb
+++ b/tool/update-bundled_gems.rb
@@ -2,13 +2,10 @@
BEGIN {
require 'rubygems'
date = nil
- if ENV.key?('GITHUB_OUTPUT')
- output = File.open(ENV['GITHUB_OUTPUT'], 'w')
- else
- output = STDERR
- end
}
END {
+ # STDOUT is not usable in inplace edit mode
+ output = $-i ? STDOUT : STDERR
output.print date.strftime("latest_date=%F") if date
}
unless /^[^#]/ !~ (gem = $F[0])