Skip to content
Snippets Groups Projects
Unverified Commit de9295cc authored by Gautham Goli's avatar Gautham Goli Committed by GitHub
Browse files

Merge pull request #6939 from Homebrew/argv-cleanup-8

ARGV: Replaces usages of ARGV.force? with Homebrew.args.force?
parents 8398d0b2 161c3fb6
No related branches found
No related tags found
No related merge requests found
......@@ -185,7 +185,7 @@ module Homebrew
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:
......
......@@ -52,7 +52,7 @@ module Homebrew
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
......
......@@ -33,10 +33,6 @@ module HomebrewArgvExtension
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
......
......@@ -349,7 +349,7 @@ class FormulaInstaller
end
def check_conflicts
return if ARGV.force?
return if Homebrew.args.force?
conflicts = formula.conflicts.select do |c|
f = Formulary.factory(c.name)
......
......@@ -108,7 +108,7 @@ class Migrator
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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment