Instruct user to tap untapped official tap when running its commands

This came up in https://github.com/Homebrew/homebrew-bundle/issues/1108
wherein a user had unwittingly untapped some official taps that get
automatically tapped on first use and couldn't figure out why they
couldn't use the associated command.
This commit is contained in:
Colin Dean 2022-07-19 18:06:42 -04:00
parent 30fda551e8
commit ac53a6ae36

View File

@ -104,6 +104,13 @@ begin
possible_tap = Tap.fetch(possible_tap.first) if possible_tap possible_tap = Tap.fetch(possible_tap.first) if possible_tap
if !possible_tap || possible_tap.installed? || Tap.untapped_official_taps.include?(possible_tap.name) if !possible_tap || possible_tap.installed? || Tap.untapped_official_taps.include?(possible_tap.name)
blocked_tap = possible_tap && Tap.untapped_official_taps.include?(possible_tap.name)
if blocked_tap
[
"`brew #{cmd}` is unavailable because #{possible_tap.name} was manually untapped and cannot be retapped.",
"Run `brew tap #{possible_tap.name}` to reenable `brew #{cmd}`.",
].each { |ln| onoe ln }
end
# Check for cask explicitly because it's very common in old guides # Check for cask explicitly because it's very common in old guides
odie "`brew cask` is no longer a `brew` command. Use `brew <command> --cask` instead." if cmd == "cask" odie "`brew cask` is no longer a `brew` command. Use `brew <command> --cask` instead." if cmd == "cask"
odie "Unknown command: #{cmd}" odie "Unknown command: #{cmd}"