Fix brew untap with HOMEBREW_INSTALL_FROM_API
This commit is contained in:
parent
95482c6767
commit
6db19212c6
@ -27,21 +27,23 @@ module Homebrew
|
||||
args.named.to_installed_taps.each do |tap|
|
||||
odie "Untapping #{tap} is not allowed" if tap.core_tap? && !Homebrew::EnvConfig.install_from_api?
|
||||
|
||||
installed_tap_formulae = Formula.installed.select { |formula| formula.tap == tap }
|
||||
installed_tap_casks = Cask::Caskroom.casks.select { |cask| cask.tap == tap }
|
||||
if !Homebrew::EnvConfig.install_from_api? || (!tap.core_tap? && tap != "homebrew/cask")
|
||||
installed_tap_formulae = Formula.installed.select { |formula| formula.tap == tap }
|
||||
installed_tap_casks = Cask::Caskroom.casks.select { |cask| cask.tap == tap }
|
||||
|
||||
if installed_tap_formulae.present? || installed_tap_casks.present?
|
||||
installed_names = (installed_tap_formulae + installed_tap_casks.map(&:token)).join("\n")
|
||||
if args.force? || Homebrew::EnvConfig.developer?
|
||||
opoo <<~EOS
|
||||
Untapping #{tap} even though it contains the following installed formulae or casks:
|
||||
#{installed_names}
|
||||
EOS
|
||||
else
|
||||
odie <<~EOS
|
||||
Refusing to untap #{tap} because it contains the following installed formulae or casks:
|
||||
#{installed_names}
|
||||
EOS
|
||||
if installed_tap_formulae.present? || installed_tap_casks.present?
|
||||
installed_names = (installed_tap_formulae + installed_tap_casks.map(&:token)).join("\n")
|
||||
if args.force? || Homebrew::EnvConfig.developer?
|
||||
opoo <<~EOS
|
||||
Untapping #{tap} even though it contains the following installed formulae or casks:
|
||||
#{installed_names}
|
||||
EOS
|
||||
else
|
||||
odie <<~EOS
|
||||
Refusing to untap #{tap} because it contains the following installed formulae or casks:
|
||||
#{installed_names}
|
||||
EOS
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user