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 | |
| parent | bba94659345acda0a0269321083181166300e899 (diff) | |
Select the destination for the latest date by whether inplace mode
| -rw-r--r-- | .github/workflows/bundled_gems.yml | 2 | ||||
| -rwxr-xr-x | tool/update-bundled_gems.rb | 7 |
2 files changed, 3 insertions, 6 deletions
diff --git a/.github/workflows/bundled_gems.yml b/.github/workflows/bundled_gems.yml index 2fb3931423..d852fa4b32 100644 --- a/.github/workflows/bundled_gems.yml +++ b/.github/workflows/bundled_gems.yml @@ -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: | 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]) |
