ENV/super: add shims_path helper method.
				
					
				
			This allows us to stop repeatedly hardcoding this on macOS/Linux in formulae.
This commit is contained in:
		
							parent
							
								
									5c602003f2
								
							
						
					
					
						commit
						2b6e580636
					
				@ -29,6 +29,13 @@ module Superenv
 | 
			
		||||
    base.run_time_deps = []
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # The location of Homebrew's shims on this OS.
 | 
			
		||||
  # @public
 | 
			
		||||
  sig { returns(Pathname) }
 | 
			
		||||
  def self.shims_path
 | 
			
		||||
    HOMEBREW_SHIMS_PATH/"super"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # @private
 | 
			
		||||
  sig { returns(T.nilable(Pathname)) }
 | 
			
		||||
  def self.bin; end
 | 
			
		||||
 | 
			
		||||
@ -4,9 +4,15 @@
 | 
			
		||||
module Superenv
 | 
			
		||||
  extend T::Sig
 | 
			
		||||
 | 
			
		||||
  # The location of Homebrew's shims on Linux.
 | 
			
		||||
  # @public
 | 
			
		||||
  def self.shims_path
 | 
			
		||||
    HOMEBREW_SHIMS_PATH/"linux/super"
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # @private
 | 
			
		||||
  def self.bin
 | 
			
		||||
    (HOMEBREW_SHIMS_PATH/"linux/super").realpath
 | 
			
		||||
    shims_path.realpath
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
  # @private
 | 
			
		||||
 | 
			
		||||
@ -5,13 +5,19 @@ module Superenv
 | 
			
		||||
  extend T::Sig
 | 
			
		||||
 | 
			
		||||
  class << self
 | 
			
		||||
    # The location of Homebrew's shims on macOS.
 | 
			
		||||
    # @public
 | 
			
		||||
    def shims_path
 | 
			
		||||
      HOMEBREW_SHIMS_PATH/"mac/super"
 | 
			
		||||
    end
 | 
			
		||||
 | 
			
		||||
    undef bin
 | 
			
		||||
 | 
			
		||||
    # @private
 | 
			
		||||
    def bin
 | 
			
		||||
      return unless DevelopmentTools.installed?
 | 
			
		||||
 | 
			
		||||
      (HOMEBREW_SHIMS_PATH/"mac/super").realpath
 | 
			
		||||
      shims_path.realpath
 | 
			
		||||
    end
 | 
			
		||||
  end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user