diff options
author | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-27 16:57:21 +0900 |
---|---|---|
committer | Nobuyoshi Nakada <nobu@ruby-lang.org> | 2023-10-27 16:57:21 +0900 |
commit | 934beac1182814ec785baab2a84e886f5f2859b2 (patch) | |
tree | 8ccc5ba906103f458275a50debead7160115b4de /tool | |
parent | bba94659345acda0a0269321083181166300e899 (diff) | |
download | ruby-934beac1182814ec785baab2a84e886f5f2859b2.tar.gz |
Select the destination for the latest date by whether inplace mode
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/update-bundled_gems.rb | 7 |
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]) |