Skip to content

Commit

Permalink
ARGV: Replaces usages of ARGV.force? with Homebrew.args.force?
Browse files Browse the repository at this point in the history
  • Loading branch information
GauthamGoli committed Jan 15, 2020
1 parent 13f508d commit 161c3fb
Show file tree
Hide file tree
Showing 5 changed files with 4 additions and 8 deletions.
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

0 comments on commit 161c3fb

Please sign in to comment.