Port Homebrew::Cmd::Untap
This commit is contained in:
parent
f8caae06f7
commit
48f4adad33
@ -1,13 +1,13 @@
|
|||||||
# typed: strict
|
# typed: strict
|
||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cli/parser"
|
require "abstract_command"
|
||||||
require "untap"
|
require "untap"
|
||||||
|
|
||||||
module Homebrew
|
module Homebrew
|
||||||
sig { returns(CLI::Parser) }
|
module Cmd
|
||||||
def self.untap_args
|
class UntapCmd < AbstractCommand
|
||||||
Homebrew::CLI::Parser.new do
|
cmd_args do
|
||||||
description <<~EOS
|
description <<~EOS
|
||||||
Remove a tapped formula repository.
|
Remove a tapped formula repository.
|
||||||
EOS
|
EOS
|
||||||
@ -16,12 +16,9 @@ module Homebrew
|
|||||||
|
|
||||||
named_args :tap, min: 1
|
named_args :tap, min: 1
|
||||||
end
|
end
|
||||||
end
|
|
||||||
|
|
||||||
sig { void }
|
|
||||||
def self.untap
|
|
||||||
args = untap_args.parse
|
|
||||||
|
|
||||||
|
sig { override.void }
|
||||||
|
def run
|
||||||
args.named.to_installed_taps.each do |tap|
|
args.named.to_installed_taps.each do |tap|
|
||||||
odie "Untapping #{tap} is not allowed" if tap.core_tap? && Homebrew::EnvConfig.no_install_from_api?
|
odie "Untapping #{tap} is not allowed" if tap.core_tap? && Homebrew::EnvConfig.no_install_from_api?
|
||||||
|
|
||||||
@ -49,3 +46,5 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
@ -1,8 +1,9 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
require "cmd/shared_examples/args_parse"
|
require "cmd/shared_examples/args_parse"
|
||||||
|
require "cmd/untap"
|
||||||
|
|
||||||
RSpec.describe "brew untap" do
|
RSpec.describe Homebrew::Cmd::UntapCmd do
|
||||||
it_behaves_like "parseable arguments"
|
it_behaves_like "parseable arguments"
|
||||||
|
|
||||||
it "untaps a given Tap", :integration_test do
|
it "untaps a given Tap", :integration_test do
|
||||||
|
Loading…
x
Reference in New Issue
Block a user