summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorThe Bundler Bot <bot@bundler.io>2018-01-31 00:20:04 +0000
committerThe Bundler Bot <bot@bundler.io>2018-01-31 00:20:04 +0000
commita0592e5d8d4b5f21df61b554b4622f0121730d7b (patch)
treed01ff9409d37b043ba47947c070ac5cad2e6e01d /lib
parentc4b022cd8a938f7640ca11be87e25d5461d66331 (diff)
parent62fd15e0198ceab8f6c54508afaa4ab3676f823d (diff)
downloadbundler-a0592e5d8d4b5f21df61b554b4622f0121730d7b.tar.gz
Auto merge of #6273 - joelvh:feature/bundle_update_gemfile_option, r=colby-swandale
Added `--gemfile` option to `bundle update` Thanks so much for the contribution! To make reviewing this PR a bit easier, please fill out answers to the following questions. ### What was the end-user problem that led to this PR? The problem was that `BUNDLE_GEMFILE` is not respected when `.bundle/config` specifies an alternate Gemfile. However, my specific issue is that `bundle install --gemfile Gemfile2` is an option, but `bundle update` won't let me specify an alternate Gemfile. ### What was your diagnosis of the problem? My diagnosis was that Bundler copies `BUNDLE_GEMFILE` environment variable to `BUNDLE_ORIG_GEMFILE` and always uses `.bundle/config`. Simplest solution was to add parity to `bundle update` rather than diagnose why environment variables don't override `.bundle/config` settings across the board. ### What is your fix for the problem, implemented in this PR? My fix is to add the `--gemfile` option to `bundle update` for parity with `bundle install`. ### Why did you choose this fix out of the possible options? I chose this fix because this allows installing and updating alternative Gemfiles without untangling environment variables. It's the most direct use case that I'm having this issue with. Ideally, the environment variables specified for a command should be respected and override settings in `.bundle/config` (https://github.com/bundler/bundler/issues/6270).
Diffstat (limited to 'lib')
-rw-r--r--lib/bundler/cli.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb
index 40ba1287fb..33796ea9a6 100644
--- a/lib/bundler/cli.rb
+++ b/lib/bundler/cli.rb
@@ -233,6 +233,8 @@ module Bundler
D
method_option "full-index", :type => :boolean, :banner =>
"Fall back to using the single-file index of all gems"
+ method_option "gemfile", :type => :string, :banner =>
+ "Use the specified gemfile instead of Gemfile"
method_option "group", :aliases => "-g", :type => :array, :banner =>
"Update a specific group"
method_option "jobs", :aliases => "-j", :type => :numeric, :banner =>