Select the destination for the latest date by whether inplace mode

This commit is contained in:
Nobuyoshi Nakada 2023-10-27 16:57:21 +09:00
parent bba9465934
commit 934beac118
No known key found for this signature in database
GPG Key ID: 3582D74E1FEE4465
2 changed files with 3 additions and 6 deletions

View File

@ -58,7 +58,7 @@ jobs:
- name: Update bundled gems list
id: bundled_gems
run: |
ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems
ruby -i~ tool/update-bundled_gems.rb gems/bundled_gems >> $GITHUB_OUTPUT
- name: Maintain updated gems list in NEWS
run: |

View File

@ -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])