Skip to content
Snippets Groups Projects
Unverified Commit d73fc480 authored by Dawid Dziurla's avatar Dawid Dziurla Committed by GitHub
Browse files

Merge pull request #9489 from dawidd6/untap-force

untap: add --force switch
parents 3e53d5ba 6248ab77
No related branches found
No related tags found
No related merge requests found
......@@ -28,6 +28,24 @@ module Homebrew
tap = Tap.fetch(tapname)
odie "Untapping #{tap} is not allowed" if tap.core_tap?
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
end
end
tap.uninstall
end
end
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment