Merge pull request #20500 from Homebrew/bump-pr-tap
dev-cmd/bump-*-pr: automatically tap core taps if needed.
This commit is contained in:
		
						commit
						1101689af2
					
				@ -71,7 +71,16 @@ module Homebrew
 | 
			
		||||
        # Use the user's browser, too.
 | 
			
		||||
        ENV["BROWSER"] = EnvConfig.browser
 | 
			
		||||
 | 
			
		||||
        cask = args.named.to_casks.fetch(0)
 | 
			
		||||
        @cask_retried = T.let(false, T.nilable(T::Boolean))
 | 
			
		||||
        cask = begin
 | 
			
		||||
          args.named.to_casks.fetch(0)
 | 
			
		||||
        rescue Cask::CaskUnavailableError
 | 
			
		||||
          raise if @cask_retried
 | 
			
		||||
 | 
			
		||||
          CoreCaskTap.instance.install(force: true)
 | 
			
		||||
          @cask_retried = true
 | 
			
		||||
          retry
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        odie "This cask is not in a tap!" if cask.tap.blank?
 | 
			
		||||
        odie "This cask's tap is not a Git repository!" unless cask.tap.git?
 | 
			
		||||
 | 
			
		||||
@ -105,14 +105,28 @@ module Homebrew
 | 
			
		||||
        # Use the user's browser, too.
 | 
			
		||||
        ENV["BROWSER"] = Homebrew::EnvConfig.browser
 | 
			
		||||
 | 
			
		||||
        formula = args.named.to_formulae.first
 | 
			
		||||
        raise FormulaUnspecifiedError if formula.blank?
 | 
			
		||||
        @tap_retried = T.let(false, T.nilable(T::Boolean))
 | 
			
		||||
        begin
 | 
			
		||||
          formula = args.named.to_formulae.first
 | 
			
		||||
          raise FormulaUnspecifiedError if formula.blank?
 | 
			
		||||
 | 
			
		||||
        odie "This formula is disabled!" if formula.disabled?
 | 
			
		||||
        odie "This formula is deprecated and does not build!" if formula.deprecation_reason == :does_not_build
 | 
			
		||||
        tap = formula.tap
 | 
			
		||||
        odie "This formula is not in a tap!" if tap.blank?
 | 
			
		||||
        odie "This formula's tap is not a Git repository!" unless tap.git?
 | 
			
		||||
          raise ArgumentError, "This formula is disabled!" if formula.disabled?
 | 
			
		||||
          if formula.deprecation_reason == :does_not_build
 | 
			
		||||
            raise ArgumentError, "This formula is deprecated and does not build!"
 | 
			
		||||
          end
 | 
			
		||||
 | 
			
		||||
          tap = formula.tap
 | 
			
		||||
          raise ArgumentError, "This formula is not in a tap!" if tap.blank?
 | 
			
		||||
          raise ArgumentError, "This formula's tap is not a Git repository!" unless tap.git?
 | 
			
		||||
 | 
			
		||||
          formula
 | 
			
		||||
        rescue ArgumentError => e
 | 
			
		||||
          odie e.message if @tap_retried
 | 
			
		||||
 | 
			
		||||
          CoreTap.instance.install(force: true)
 | 
			
		||||
          @tap_retried = true
 | 
			
		||||
          retry
 | 
			
		||||
        end
 | 
			
		||||
 | 
			
		||||
        odie <<~EOS unless tap.allow_bump?(formula.name)
 | 
			
		||||
          Whoops, the #{formula.name} formula has its version update
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user