brew install will suggest brew cask install
If the user tries to install a cask using brew install then brew will suggest the user tries 'brew cask install' closes #6245
This commit is contained in:
parent
99ed23347a
commit
25e7eaee1f
@ -19,7 +19,11 @@ module Homebrew
|
||||
|
||||
cask = Cask::CaskLoader.load(name)
|
||||
reason = +"Found a cask named \"#{name}\" instead.\n"
|
||||
reason << Cask::Cmd::Info.get_info(cask) if show_info
|
||||
if show_info
|
||||
reason << Cask::Cmd::Info.get_info(cask)
|
||||
else
|
||||
reason << "Did you mean to type \"brew cask install #{name}\"?\n"
|
||||
end
|
||||
reason.freeze
|
||||
rescue Cask::CaskUnavailableError
|
||||
nil
|
||||
|
||||
@ -100,6 +100,7 @@ describe Homebrew::MissingFormula do
|
||||
let(:show_info) { false }
|
||||
|
||||
it { is_expected.to match(/Found a cask named "local-caffeine" instead./) }
|
||||
it { is_expected.to match(/Did you mean to type "brew cask install local-caffeine"?/) }
|
||||
end
|
||||
|
||||
context "with a formula name that is a cask and show_info: true" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user