requirement: prepend rather than append PATH.

Otherwise this ends up behind e.g. `/usr/bin` so is pretty useless.
This commit is contained in:
Mike McQuaid 2017-10-28 19:48:21 +01:00
parent 302bc8be22
commit c843fd2f12
2 changed files with 2 additions and 2 deletions

View File

@ -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

View File

@ -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