Merge pull request #12608 from xxyzz/fix-bump-multilang-cask

bump-cask-pr: avoid replacing sha256 twice on multilang cask
This commit is contained in:
Rylan Polster 2022-01-16 11:52:34 -05:00 committed by GitHub
commit 537036ab36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -145,15 +145,13 @@ module Homebrew
end end
cask.languages.each do |language| cask.languages.each do |language|
next if language == cask.language
lang_config = tmp_config.merge(Cask::Config.new(explicit: { languages: [language] })) lang_config = tmp_config.merge(Cask::Config.new(explicit: { languages: [language] }))
replacement_pairs << fetch_cask(tmp_contents, config: lang_config) replacement_pairs << fetch_cask(tmp_contents, config: lang_config)
end end
end end
end end
if new_hash.present? if new_hash.present? && cask.language.blank? # avoid repeated replacement for multilanguage cask
hash_regex = old_hash == :no_check ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']" hash_regex = old_hash == :no_check ? ":no_check" : "[\"']#{Regexp.escape(old_hash.to_s)}[\"']"
replacement_pairs << [ replacement_pairs << [