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

ARGV: Replaces usages of ARGV.force? with Homebrew.args.force?
This commit is contained in:
Gautham Goli 2020-01-15 21:25:36 +05:30 committed by GitHub
commit de9295cc7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 4 additions and 8 deletions

View File

@ -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:

View File

@ -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

View File

@ -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

View File

@ -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)

View File

@ -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