Skip to content

Commit

Permalink
bump-cask-pr: bump language checksums in non-running hardware
Browse files Browse the repository at this point in the history
  • Loading branch information
cho-m committed Oct 14, 2021
1 parent 976f9da commit b744663
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions Library/Homebrew/dev-cmd/bump-cask-pr.rb
Original file line number Diff line number Diff line change
Expand Up @@ -131,22 +131,29 @@ def bump_cask_pr
tmp_cask = Cask::CaskLoader.load(tmp_contents)
tmp_config = tmp_cask.config

if old_hash != :no_check
new_hash = fetch_cask(tmp_contents)[1] if new_hash.nil?

if tmp_contents.include?("Hardware::CPU.intel?")
other_intel = !Hardware::CPU.intel?
other_contents = tmp_contents.gsub("Hardware::CPU.intel?", other_intel.to_s)
replacement_pairs << fetch_cask(other_contents)
end
end
new_hash = fetch_cask(tmp_contents)[1] if old_hash != :no_check && new_hash.nil?

cask.languages.each do |language|
next if language == cask.language

lang_config = tmp_config.merge(Cask::Config.new(explicit: { languages: [language] }))
replacement_pairs << fetch_cask(tmp_contents, config: lang_config)
end

if tmp_contents.include?("Hardware::CPU.intel?")
other_intel = !Hardware::CPU.intel?
other_contents = tmp_contents.gsub("Hardware::CPU.intel?", other_intel.to_s)
other_cask = Cask::CaskLoader.load(other_contents)

replacement_pairs << fetch_cask(other_contents) if other_cask.sha256 != :no_check

other_cask.languages.each do |language|
next if language == other_cask.language

lang_config = other_cask.config.merge(Cask::Config.new(explicit: { languages: [language] }))
replacement_pairs << fetch_cask(other_contents, config: lang_config)
end
end
end
end

Expand Down

0 comments on commit b744663

Please sign in to comment.