Merge pull request #14350 from Rylan12/fix-depends-on-arch

Fix `depends_on arch:` when loading casks from API
This commit is contained in:
Mike McQuaid 2023-01-11 19:24:55 +00:00 committed by GitHub
commit 9dbd76fced
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -240,6 +240,14 @@ module Cask
if json_cask[:depends_on].present?
dep_hash = json_cask[:depends_on].to_h do |dep_key, dep_value|
# Arch dependencies are encoded like `{ type: :intel, bits: 64 }`
# but `depends_on arch:` only accepts `:intel` or `:arm64`
if dep_key == :arch
next [:arch, :intel] if dep_value.first[:type] == "intel"
next [:arch, :arm64]
end
next [dep_key, dep_value] unless dep_key == :macos
dep_type = dep_value.keys.first