aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/formula.rb
diff options
context:
space:
mode:
authorMike McQuaid2017-12-14 09:20:07 +0000
committerMike McQuaid2017-12-14 09:20:07 +0000
commitb085da91c37e3002f6c5eea8e97d5ce0eabb97bf (patch)
tree8ba2b5c0da0bd50b2865ec1222d8dcd5480adea1 /Library/Homebrew/formula.rb
parent71ebfa76c53408a2fb40cbc95bb6f39be27da6b7 (diff)
downloadbrew-b085da91c37e3002f6c5eea8e97d5ce0eabb97bf.tar.bz2
postinstall: add HOMEBREW_PREFIX/{,s}bin to PATH.
This avoids the need for workarounds such as: https://github.com/Homebrew/homebrew-core/pull/21688
Diffstat (limited to 'Library/Homebrew/formula.rb')
-rw-r--r--Library/Homebrew/formula.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/formula.rb b/Library/Homebrew/formula.rb
index f3b6c1db1..ef545421a 100644
--- a/Library/Homebrew/formula.rb
+++ b/Library/Homebrew/formula.rb
@@ -956,12 +956,16 @@ class Formula
@prefix_returns_versioned_prefix = true
build = self.build
self.build = Tab.for_formula(self)
+ path_with_prefix = PATH.new(ENV["PATH"])
+ .append(HOMEBREW_PREFIX/"bin")
+ .append(HOMEBREW_PREFIX/"sbin")
new_env = {
"TMPDIR" => HOMEBREW_TEMP,
"TEMP" => HOMEBREW_TEMP,
"TMP" => HOMEBREW_TEMP,
"HOMEBREW_PATH" => nil,
+ "PATH" => path_with_prefix,
}
with_env(new_env) do