summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/bundler.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index 2e7f324002..b0f166040f 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -293,12 +293,12 @@ module Bundler
def which(executable)
if File.file?(executable) && File.executable?(executable)
executable
- elsif ENV["PATH"]
- path = ENV["PATH"].split(File::PATH_SEPARATOR).find do |p|
+ elsif path = ENV["PATH"]
+ executable_path = path.split(File::PATH_SEPARATOR).find do |p|
abs_path = File.join(p, executable)
File.file?(abs_path) && File.executable?(abs_path)
end
- path && File.expand_path(executable, path)
+ executable_path && File.expand_path(executable, executable_path)
end
end