summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Arko <andre@arko.net>2018-07-09 22:50:45 -0700
committerAndre Arko <andre@arko.net>2018-07-09 22:50:45 -0700
commit865ec52ae87c29473405ce587977dd3eaef453ae (patch)
treeff2187e4c7db07bd5da70b86f15c8dd3211844df
parent8779946b56c33d45855350482c00c828825d667d (diff)
downloadbundler-865ec52ae87c29473405ce587977dd3eaef453ae.tar.gz
only realpath things that exist
-rw-r--r--lib/bundler/shared_helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/bundler/shared_helpers.rb b/lib/bundler/shared_helpers.rb
index e4cbbba2ba..f9ac9a760a 100644
--- a/lib/bundler/shared_helpers.rb
+++ b/lib/bundler/shared_helpers.rb
@@ -344,9 +344,10 @@ module Bundler
def resolve_path(path)
expanded = File.expand_path(path)
+ return expanded unless File.respond_to?(:realpath)
- if File.respond_to?(:realpath)
- expanded = File.realpath(expanded) until expanded == File.realpath(expanded)
+ while File.exist?(expanded) && File.realpath(expanded) != expanded
+ expanded = File.realpath(expanded)
end
expanded