[Linux] Don't prompt users to brew cask install
- I tried to install `keybase`, thinking I'd get the CLI. On Linux, casks don't work, yet I was still prompted to `brew cask install keybase`. When I tried that (just to make sure), I got the "casks are only supported on MacOS" error. - This change makes it so we don't prompt people to install casks if they're on platforms other than MacOS. Before: ``` ╭─issyl0@grus /home/linuxbrew/.linuxbrew/Homebrew ‹master› ╰─ $ brew install keybase Error: No available formula with the name "keybase" Found a cask named "keybase" instead. ``` After: ``` Error: No available formula with the name "keybase" ==> Searching for a previously deleted formula (in the last month)... Warning: homebrew/core is shallow clone. To get complete history run: git -C "$(brew --repo homebrew/core)" fetch --unshallow Error: No previously deleted formula found. ==> Searching for similarly named formulae... Error: No similarly named formulae found. ==> Searching taps... ==> Searching taps on GitHub... Error: No formulae found in taps. ```
This commit is contained in:
parent
50138dbbe3
commit
4a5b02661a
@ -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
|
||||||
|
|||||||
@ -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
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user