summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-03 11:50:59 +0100
committerDavid Rodríguez <deivid.rodriguez@riseup.net>2020-02-03 12:27:26 +0100
commit2a62902a202c3fc0d576b016d28a93f0d18f955f (patch)
treed57243bffe1d1e4dce98db5eb7ea29a76c7124da /lib
parent203d02c3670083a95733afc1a9d7a870d1ae1c34 (diff)
downloadbundler-2a62902a202c3fc0d576b016d28a93f0d18f955f.tar.gz
Fix config location edge caseapp_config_path_absolute
If `BUNDLE_APP_CONFIG` is set to an absolute path, and there's no Gemfile up in the directory hierarchy, bundler would end up using the default config location instead of the customized one. This commit fixes that.
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/bundler.rb b/lib/bundler.rb
index df345539c8..f081d4d63f 100644
--- a/lib/bundler.rb
+++ b/lib/bundler.rb
@@ -285,7 +285,13 @@ module Bundler
def app_config_path
if app_config = ENV["BUNDLE_APP_CONFIG"]
- Pathname.new(app_config).expand_path(root)
+ app_config_pathname = Pathname.new(app_config)
+
+ if app_config_pathname.absolute?
+ app_config_pathname
+ else
+ app_config_pathname.expand_path(root)
+ end
else
root.join(".bundle")
end