summaryrefslogtreecommitdiff
path: root/lib/bundler/cli.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/bundler/cli.rb')
-rw-r--r--lib/bundler/cli.rb12
1 files changed, 8 insertions, 4 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 6f7ff90dc2..aef434f569 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -54,10 +54,14 @@ module Bundler
def initialize(*args)
super
- custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
- if custom_gemfile && !custom_gemfile.empty?
- Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
- Bundler.reset_paths!
+ if Bundler.feature_flag.config_relative_to_cwd?
+ Bundler.settings.set_command_option_if_given :gemfile, options[:gemfile]
+ else
+ custom_gemfile = options[:gemfile] || Bundler.settings[:gemfile]
+ if custom_gemfile && !custom_gemfile.empty?
+ Bundler::SharedHelpers.set_env "BUNDLE_GEMFILE", File.expand_path(custom_gemfile)
+ Bundler.reset_paths!
+ end
end
Bundler.settings.set_command_option_if_given :retry, options[:retry]