Always prefer default tap.
This commit is contained in:
parent
48c9897081
commit
c39abef045
@ -458,19 +458,12 @@ module Cask
|
||||
when 1
|
||||
loaders.first
|
||||
when 2..Float::INFINITY
|
||||
default_tap_loaders, other_loaders = *loaders.partition { _1.tap.core_cask_tap? }
|
||||
default_tap_loader = default_tap_loaders.first if default_tap_loaders.count
|
||||
# Always prefer the default tap, i.e. behave the same as if loading from the API.
|
||||
if (default_tap_loader = loaders.find { _1.tap.core_cask_tap? })
|
||||
return default_tap_loader
|
||||
end
|
||||
|
||||
# Put default tap last so that the error message always recommends
|
||||
# using the fully-qualified name for non-default taps.
|
||||
taps = other_loaders.map(&:tap) + default_tap_loaders.map(&:tap)
|
||||
|
||||
error = TapCaskAmbiguityError.new(token, taps)
|
||||
|
||||
raise error unless default_tap_loader
|
||||
|
||||
opoo error if warn
|
||||
default_tap_loader
|
||||
raise TapCaskAmbiguityError.new(token, loaders.map(&:tap))
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user