ARGV: Deprecate ARGV.casks and replace with Homebrew.args.casks

This commit is contained in:
Gautham G 2020-05-02 13:21:16 +05:30
parent bffe4dde96
commit 38c24d134c
3 changed files with 2 additions and 13 deletions

View File

@ -114,13 +114,13 @@ module Homebrew
formulae = []
unless ARGV.casks.empty?
unless Homebrew.args.casks.empty?
cask_args = []
cask_args << "--force" if args.force?
cask_args << "--debug" if args.debug?
cask_args << "--verbose" if args.verbose?
ARGV.casks.each do |c|
Homebrew.args.casks.each do |c|
ohai "brew cask install #{c} #{cask_args.join " "}"
system("#{HOMEBREW_PREFIX}/bin/brew", "cask", "install", c, *cask_args)
end

View File

@ -5,11 +5,6 @@ module HomebrewArgvExtension
select { |arg| arg.start_with?("--") }
end
def casks
# TODO: use @instance variable to ||= cache when moving to CLI::Parser
downcased_unique_named.grep HOMEBREW_CASK_TAP_CASK_REGEX
end
def value(name)
arg_prefix = "--#{name}="
flag_with_value = find { |arg| arg.start_with?(arg_prefix) }

View File

@ -7,12 +7,6 @@ describe HomebrewArgvExtension do
let(:argv) { ["mxcl"] }
describe "#casks" do
it "returns an empty array if there is no match" do
expect(subject.casks).to eq []
end
end
describe "#named" do
let(:argv) { ["foo", "--debug", "-v"] }