ARGV: Deprecate ARGV.casks and replace with Homebrew.args.casks
This commit is contained in:
parent
bffe4dde96
commit
38c24d134c
@ -114,13 +114,13 @@ module Homebrew
|
|||||||
|
|
||||||
formulae = []
|
formulae = []
|
||||||
|
|
||||||
unless ARGV.casks.empty?
|
unless Homebrew.args.casks.empty?
|
||||||
cask_args = []
|
cask_args = []
|
||||||
cask_args << "--force" if args.force?
|
cask_args << "--force" if args.force?
|
||||||
cask_args << "--debug" if args.debug?
|
cask_args << "--debug" if args.debug?
|
||||||
cask_args << "--verbose" if args.verbose?
|
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 " "}"
|
ohai "brew cask install #{c} #{cask_args.join " "}"
|
||||||
system("#{HOMEBREW_PREFIX}/bin/brew", "cask", "install", c, *cask_args)
|
system("#{HOMEBREW_PREFIX}/bin/brew", "cask", "install", c, *cask_args)
|
||||||
end
|
end
|
||||||
|
@ -5,11 +5,6 @@ module HomebrewArgvExtension
|
|||||||
select { |arg| arg.start_with?("--") }
|
select { |arg| arg.start_with?("--") }
|
||||||
end
|
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)
|
def value(name)
|
||||||
arg_prefix = "--#{name}="
|
arg_prefix = "--#{name}="
|
||||||
flag_with_value = find { |arg| arg.start_with?(arg_prefix) }
|
flag_with_value = find { |arg| arg.start_with?(arg_prefix) }
|
||||||
|
@ -7,12 +7,6 @@ describe HomebrewArgvExtension do
|
|||||||
|
|
||||||
let(:argv) { ["mxcl"] }
|
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
|
describe "#named" do
|
||||||
let(:argv) { ["foo", "--debug", "-v"] }
|
let(:argv) { ["foo", "--debug", "-v"] }
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user