feat: add linux support to bump-cask-pr
This commit is contained in:
parent
2462e40ca5
commit
7687ae3891
@ -191,9 +191,16 @@ module Homebrew
|
|||||||
}
|
}
|
||||||
def replace_version_and_checksum(cask, new_hash, new_version, replacement_pairs)
|
def replace_version_and_checksum(cask, new_hash, new_version, replacement_pairs)
|
||||||
# When blocks are absent, arch is not relevant. For consistency, we simulate the arm architecture.
|
# When blocks are absent, arch is not relevant. For consistency, we simulate the arm architecture.
|
||||||
arch_options = cask.on_system_blocks_exist? ? OnSystem::ARCH_OPTIONS : [:arm]
|
system_options = if !cask.on_system_blocks_exist?
|
||||||
arch_options.each do |arch|
|
[:macos, :arm]
|
||||||
SimulateSystem.with(arch:) do
|
elsif cask.on_system_blocks_exist? && cask.os.nil?
|
||||||
|
[:macos].product(OnSystem::ARCH_OPTIONS)
|
||||||
|
else
|
||||||
|
OnSystem::BASE_OS_OPTIONS.product(OnSystem::ARCH_OPTIONS) :
|
||||||
|
end
|
||||||
|
|
||||||
|
system_options.each do |os, arch|
|
||||||
|
SimulateSystem.with(os:, arch:) do
|
||||||
old_cask = Cask::CaskLoader.load(cask.sourcefile_path)
|
old_cask = Cask::CaskLoader.load(cask.sourcefile_path)
|
||||||
old_version = old_cask.version
|
old_version = old_cask.version
|
||||||
bump_version = new_version.send(arch) || new_version.general
|
bump_version = new_version.send(arch) || new_version.general
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user