ARGV: Replaces usages of ARGV.force? with Homebrew.args.force?
This commit is contained in:
		
							parent
							
								
									13f508d0dc
								
							
						
					
					
						commit
						161c3fb6a4
					
				@ -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
 | 
			
		||||
 | 
			
		||||
@ -45,10 +45,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
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user