Improve install cmd error msg

It now specifies casks, formulae or both in
theh output based upon the user args given.
This commit is contained in:
apainintheneck 2022-12-31 15:52:05 -08:00
parent a8384c0ce7
commit d291117468

View File

@ -297,7 +297,12 @@ module Homebrew
return if name.include?("/")
require "search"
ohai "Searching for similarly named formulae and casks..."
package_types = []
package_types << "formulae" unless args.cask?
package_types << "casks" unless args.formula?
ohai "Searching for similarly named #{package_types.join(" and ")}..."
# Don't treat formula/cask name as a regex
query = string_or_regex = name
@ -324,6 +329,6 @@ module Homebrew
end
return if all_formulae.any? || all_casks.any?
odie "No formulae or casks found for #{name}."
odie "No #{package_types.join(" or ")} found for #{name}."
end
end