From c25cf1eaaa886aaf510ebe92961daab716a6faef Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 21 Jul 2021 20:44:13 +0900 Subject: [PATCH] Drop optional commit hash when updated --- tool/update-bundled_gems.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) mode change 100644 => 100755 tool/update-bundled_gems.rb diff --git a/tool/update-bundled_gems.rb b/tool/update-bundled_gems.rb old mode 100644 new mode 100755 index cef31e2f13..48dcaa9f2c --- a/tool/update-bundled_gems.rb +++ b/tool/update-bundled_gems.rb @@ -9,6 +9,12 @@ unless /^[^#]/ !~ (gem = $F[0]) gem = src.fetch_spec(gem) uri = gem.metadata["source_code_uri"] || gem.homepage uri = uri.sub(%r[\Ahttps://github\.com/[^/]+/[^/]+\K/tree/.*], "").chomp(".git") - $F[3][$F[1]] = gem.version.to_s if $F[3] && $F[3].include?($F[1]) + if $F[3] + if $F[3].include?($F[1]) + $F[3][$F[1]] = gem.version.to_s + elsif $F[2] != gem.version and /\A\h+\z/ =~ $F[3] + $F[3..-1] = [] + end + end $_ = [gem.name, gem.version, uri, *$F[3..-1]].join(" ") end