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 = []
|
base.run_time_deps = []
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# The location of Homebrew's shims on this OS.
|
||||||
|
# @public
|
||||||
|
sig { returns(Pathname) }
|
||||||
|
def self.shims_path
|
||||||
|
HOMEBREW_SHIMS_PATH/"super"
|
||||||
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
sig { returns(T.nilable(Pathname)) }
|
sig { returns(T.nilable(Pathname)) }
|
||||||
def self.bin; end
|
def self.bin; end
|
||||||
|
|||||||
@ -4,9 +4,15 @@
|
|||||||
module Superenv
|
module Superenv
|
||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
|
# The location of Homebrew's shims on Linux.
|
||||||
|
# @public
|
||||||
|
def self.shims_path
|
||||||
|
HOMEBREW_SHIMS_PATH/"linux/super"
|
||||||
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def self.bin
|
def self.bin
|
||||||
(HOMEBREW_SHIMS_PATH/"linux/super").realpath
|
shims_path.realpath
|
||||||
end
|
end
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
|
|||||||
@ -5,13 +5,19 @@ module Superenv
|
|||||||
extend T::Sig
|
extend T::Sig
|
||||||
|
|
||||||
class << self
|
class << self
|
||||||
|
# The location of Homebrew's shims on macOS.
|
||||||
|
# @public
|
||||||
|
def shims_path
|
||||||
|
HOMEBREW_SHIMS_PATH/"mac/super"
|
||||||
|
end
|
||||||
|
|
||||||
undef bin
|
undef bin
|
||||||
|
|
||||||
# @private
|
# @private
|
||||||
def bin
|
def bin
|
||||||
return unless DevelopmentTools.installed?
|
return unless DevelopmentTools.installed?
|
||||||
|
|
||||||
(HOMEBREW_SHIMS_PATH/"mac/super").realpath
|
shims_path.realpath
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user