Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ARGV: Replaces usages of ARGV.force? with Homebrew.args.force? #6939

Merged
merged 1 commit into from
Jan 15, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/extract.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ def extract

path = destination_tap.path/"Formula/#{name}@#{version}.rb"
if path.exist?
unless ARGV.force?
unless Homebrew.args.force?
odie <<~EOS
Destination formula already exists: #{path}
To overwrite it and continue anyways, run:
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/dev-cmd/test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def test
end

# Don't test unlinked formulae
if !ARGV.force? && !f.keg_only? && !f.linked?
if !Homebrew.args.force? && !f.keg_only? && !f.linked?
ofail "#{f.full_name} is not linked"
next
end
Expand Down
4 changes: 0 additions & 4 deletions Library/Homebrew/extend/ARGV.rb
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,6 @@ def value(name)
flag_with_value&.delete_prefix(arg_prefix)
end

def force?
flag? "--force"
end

def verbose?
flag?("--verbose") || !ENV["VERBOSE"].nil? || !ENV["HOMEBREW_VERBOSE"].nil?
end
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,7 @@ def install
end

def check_conflicts
return if ARGV.force?
return if Homebrew.args.force?

conflicts = formula.conflicts.select do |c|
f = Formulary.factory(c.name)
Expand Down
2 changes: 1 addition & 1 deletion Library/Homebrew/migrator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def self.migrate_if_needed(formula)
end
end

def initialize(formula, force: ARGV.force?)
def initialize(formula, force: Homebrew.args.force?)
@oldname = formula.oldname
@newname = formula.name
raise MigratorNoOldnameError, formula unless oldname
Expand Down