aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike McQuaid2017-10-28 19:48:21 +0100
committerMike McQuaid2017-11-03 14:50:17 +0000
commitc843fd2f12cdff5d0309b1665bb5ad29ac1d8164 (patch)
treec09ea06f109692135e520e55b5666f0804f13c2f
parent302bc8be22c9f645a110815f52f252a78c666d0f (diff)
downloadbrew-c843fd2f12cdff5d0309b1665bb5ad29ac1d8164.tar.bz2
requirement: prepend rather than append PATH.
Otherwise this ends up behind e.g. `/usr/bin` so is pretty useless.
-rw-r--r--Library/Homebrew/requirement.rb2
-rw-r--r--Library/Homebrew/test/requirement_spec.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/Library/Homebrew/requirement.rb b/Library/Homebrew/requirement.rb
index a69c68466..c98ea95e8 100644
--- a/Library/Homebrew/requirement.rb
+++ b/Library/Homebrew/requirement.rb
@@ -95,7 +95,7 @@ class Requirement
parent = satisfied_result_parent
return unless parent
return if PATH.new(ENV["PATH"]).include?(parent.to_s)
- ENV.append_path("PATH", parent)
+ ENV.prepend_path("PATH", parent)
end
def env
diff --git a/Library/Homebrew/test/requirement_spec.rb b/Library/Homebrew/test/requirement_spec.rb
index 11a3da8f4..2d0d86c86 100644
--- a/Library/Homebrew/test/requirement_spec.rb
+++ b/Library/Homebrew/test/requirement_spec.rb
@@ -138,7 +138,7 @@ describe Requirement do
end
it "infers path from #satisfy result" do
- expect(ENV).to receive(:append_path).with("PATH", Pathname.new("/foo/bar"))
+ expect(ENV).to receive(:prepend_path).with("PATH", Pathname.new("/foo/bar"))
subject.satisfied?
subject.modify_build_environment
end