Merge pull request #6156 from issyl0/dont_show_missing_formula_cask_info_on_linux

[Linux] Don't prompt users to `brew cask install`
This commit is contained in:
Mike McQuaid 2019-05-26 09:48:04 +01:00 committed by GitHub
commit 515aef9863
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 10 deletions

View File

@ -13,6 +13,17 @@ module Homebrew
generic_blacklisted_reason(name) generic_blacklisted_reason(name)
end end
end end
def cask_reason(name, silent: false, show_info: false)
return if silent
cask = Cask::CaskLoader.load(name)
reason = +"Found a cask named \"#{name}\" instead.\n"
reason << Cask::Cmd::Info.get_info(cask) if show_info
reason.freeze
rescue Cask::CaskUnavailableError
nil
end
end end
end end
end end

View File

@ -196,16 +196,7 @@ module Homebrew
end end
end end
def cask_reason(name, silent: false, show_info: false) def cask_reason(name, silent: false, show_info: false); end
return if silent
cask = Cask::CaskLoader.load(name)
reason = +"Found a cask named \"#{name}\" instead.\n"
reason << Cask::Cmd::Info.get_info(cask) if show_info
reason.freeze
rescue Cask::CaskUnavailableError
nil
end
require "extend/os/missing_formula" require "extend/os/missing_formula"
end end