Don't warn while checking for conflicting casks.

This commit is contained in:
Markus Reiter 2024-03-06 23:24:04 +01:00
parent 76c7245d10
commit 42652442af
No known key found for this signature in database
GPG Key ID: 245293B51702655B

View File

@ -417,8 +417,10 @@ module Homebrew
def warn_if_cask_conflicts(ref, loaded_type) def warn_if_cask_conflicts(ref, loaded_type)
message = "Treating #{ref} as a #{loaded_type}." message = "Treating #{ref} as a #{loaded_type}."
begin begin
cask = Cask::CaskLoader.load ref cask = Cask::CaskLoader.load(ref, warn: false)
message += " For the cask, use #{cask.tap.name}/#{cask.token}" if cask.tap.present? message += " For the cask, "
message += "use #{cask.tap.name}/#{cask.token} or " if cask.tap
message += "specify the `--cask` flag."
rescue Cask::CaskUnreadableError => e rescue Cask::CaskUnreadableError => e
# Need to rescue before `CaskUnavailableError` (superclass of this) # Need to rescue before `CaskUnavailableError` (superclass of this)
# The cask was found, but there's a problem with its implementation # The cask was found, but there's a problem with its implementation