Don't tap user-untapped official taps
This commit is contained in:
parent
152eac333b
commit
3ca68c076e
@ -132,7 +132,10 @@ begin
|
|||||||
possible_tap = OFFICIAL_CMD_TAPS.find { |_, cmds| cmds.include?(cmd) }
|
possible_tap = OFFICIAL_CMD_TAPS.find { |_, cmds| cmds.include?(cmd) }
|
||||||
possible_tap = Tap.fetch(possible_tap.first) if possible_tap
|
possible_tap = Tap.fetch(possible_tap.first) if possible_tap
|
||||||
|
|
||||||
odie "Unknown command: #{cmd}" if !possible_tap || possible_tap.installed?
|
untapped_official_taps = Homebrew::Settings.read(:untapped)&.split(";") || []
|
||||||
|
if !possible_tap || possible_tap.installed? || untapped_official_taps.include?(possible_tap.name)
|
||||||
|
odie "Unknown command: #{cmd}"
|
||||||
|
end
|
||||||
|
|
||||||
# Unset HOMEBREW_HELP to avoid confusing the tap
|
# Unset HOMEBREW_HELP to avoid confusing the tap
|
||||||
with_env HOMEBREW_HELP: nil do
|
with_env HOMEBREW_HELP: nil do
|
||||||
|
|||||||
@ -5,6 +5,9 @@ class Tap
|
|||||||
def self.install_default_cask_tap_if_necessary
|
def self.install_default_cask_tap_if_necessary
|
||||||
return false if default_cask_tap.installed?
|
return false if default_cask_tap.installed?
|
||||||
|
|
||||||
|
untapped_official_taps = Homebrew::Settings.read(:untapped)&.split(";") || []
|
||||||
|
return false if untapped_official_taps.include?(default_cask_tap.name)
|
||||||
|
|
||||||
default_cask_tap.install
|
default_cask_tap.install
|
||||||
true
|
true
|
||||||
end
|
end
|
||||||
|
|||||||
@ -326,6 +326,17 @@ class Tap
|
|||||||
.update_from_formula_names!(formula_names)
|
.update_from_formula_names!(formula_names)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
if official?
|
||||||
|
untapped = Homebrew::Settings.read(:untapped)&.split(";") || []
|
||||||
|
untapped -= [name]
|
||||||
|
|
||||||
|
if untapped.empty?
|
||||||
|
Homebrew::Settings.delete :untapped
|
||||||
|
else
|
||||||
|
Homebrew::Settings.write :untapped, untapped.join(";")
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
return if clone_target
|
return if clone_target
|
||||||
return unless private?
|
return unless private?
|
||||||
return if quiet
|
return if quiet
|
||||||
@ -374,6 +385,15 @@ class Tap
|
|||||||
|
|
||||||
Commands.rebuild_commands_completion_list
|
Commands.rebuild_commands_completion_list
|
||||||
clear_cache
|
clear_cache
|
||||||
|
|
||||||
|
return unless official?
|
||||||
|
|
||||||
|
untapped = Homebrew::Settings.read(:untapped)&.split(";") || []
|
||||||
|
|
||||||
|
return if untapped.include? name
|
||||||
|
|
||||||
|
untapped << name
|
||||||
|
Homebrew::Settings.write :untapped, untapped.join(";")
|
||||||
end
|
end
|
||||||
|
|
||||||
# True if the {#remote} of {Tap} is customized.
|
# True if the {#remote} of {Tap} is customized.
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user