cmd/fetch: handle nil cask urls
These urls can be nil if there is an unsatisfied macos version requirement. We check for false here because either the macos requirement can be satisfied and return true or can not be specified and return nil. If it's not specified, it means it can run on any macos version. The change in Cask::Download should provide better error messages in Downloadable but honestly we're better off just checking for the missing url higher up the call stack which is why I made the changes in the fetch command. Either way it seemed like a good idea while I'm here.
This commit is contained in:
parent
51387287f7
commit
8c2f101138
@ -24,6 +24,8 @@ module Cask
|
||||
|
||||
sig { override.returns(T.nilable(::URL)) }
|
||||
def url
|
||||
return if cask.url.nil?
|
||||
|
||||
@url ||= ::URL.new(cask.url.to_s, cask.url.specs)
|
||||
end
|
||||
|
||||
|
@ -167,6 +167,11 @@ module Homebrew
|
||||
SimulateSystem.with os: os, arch: arch do
|
||||
cask = Cask::CaskLoader.load(ref)
|
||||
|
||||
if cask.depends_on.macos&.satisfied? == false
|
||||
opoo "#{cask.token}: #{cask.depends_on.macos.message(type: :cask)}"
|
||||
next
|
||||
end
|
||||
|
||||
quarantine = args.quarantine?
|
||||
quarantine = true if quarantine.nil?
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user