Merge pull request #8553 from MikeMcQuaid/named_args_no_cask_tap

cli/named_args: handle missing cask tap.
This commit is contained in:
Mike McQuaid 2020-09-01 09:45:19 +01:00 committed by GitHub
commit de3df53a1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -180,8 +180,9 @@ module Homebrew
def warn_if_cask_conflicts(ref, loaded_type)
cask = Cask::CaskLoader.load ref
opoo "Treating #{ref} as a #{loaded_type}. For the cask, use #{cask.tap.name}/#{cask.token}"
message = "Treating #{ref} as a #{loaded_type}."
message += " For the cask, use #{cask.tap.name}/#{cask.token}" if cask.tap.present?
opoo message.freeze
rescue Cask::CaskUnavailableError
# No ref conflict with a cask, do nothing
end