From 42652442af442dd08a8507bb6eb43f8992e22cfa Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Wed, 6 Mar 2024 23:24:04 +0100 Subject: [PATCH] Don't warn while checking for conflicting casks. --- Library/Homebrew/cli/named_args.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/Homebrew/cli/named_args.rb b/Library/Homebrew/cli/named_args.rb index 9b470f4f2e..6fc7202b89 100644 --- a/Library/Homebrew/cli/named_args.rb +++ b/Library/Homebrew/cli/named_args.rb @@ -417,8 +417,10 @@ module Homebrew def warn_if_cask_conflicts(ref, loaded_type) message = "Treating #{ref} as a #{loaded_type}." begin - cask = Cask::CaskLoader.load ref - message += " For the cask, use #{cask.tap.name}/#{cask.token}" if cask.tap.present? + cask = Cask::CaskLoader.load(ref, warn: false) + message += " For the cask, " + message += "use #{cask.tap.name}/#{cask.token} or " if cask.tap + message += "specify the `--cask` flag." rescue Cask::CaskUnreadableError => e # Need to rescue before `CaskUnavailableError` (superclass of this) # The cask was found, but there's a problem with its implementation