mirror of
https://github.com/Homebrew/brew.git
synced 2025-07-14 16:09:03 +08:00
Merge pull request #19510 from Homebrew/feat/bump-cask/on_linux
feat: add linux support to bump-cask-pr
This commit is contained in:
commit
faddb73204
@ -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.depends_on.macos
|
||||||
|
[: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