Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
Merge #7078
Browse files Browse the repository at this point in the history
7078: Allow `update` to install when `--no-install` used r=colby-swandale a=deivid-rodriguez

Fixes #7077.

### What was the end-user problem that led to this PR?

The problem was #7077. When the `no_install` configuration is activated, this prevents `bundle update` from installing gems, but `no_install` is only meant to affect `bundle package`.

### What was your diagnosis of the problem?

My diagnosis was that `bundle update` needs to ignore this setting.

### What is your fix for the problem, implemented in this PR?

My fix is to the same `bundle install` does to fix this problem.

### Why did you choose this fix out of the possible options?

I chose this fix because it's the most straightforward solution, although the handling of this flag could probably use some refactoring.


Co-authored-by: David Rodríguez <deivid.rodriguez@riseup.net>
(cherry picked from commit 91912a1)
  • Loading branch information
bundlerbot authored and colby-swandale committed Apr 4, 2019
1 parent f674ead commit 79b479c
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,9 @@ def install
def update(*gems)
SharedHelpers.major_deprecation(3, "The `--force` option has been renamed to `--redownload`") if ARGV.include?("--force")
require "bundler/cli/update"
Update.new(options, gems).run
Bundler.settings.temporary(:no_install => false) do
Update.new(options, gems).run
end
end

desc "show GEM [OPTIONS]", "Shows all gems that are part of the bundle, or the path to a given gem"
Expand Down
12 changes: 12 additions & 0 deletions spec/commands/package_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,18 @@

expect(the_bundle).to include_gems "rack 1.0.0"
end

it "does not prevent installing gems with bundle update" do
gemfile <<-D
source "file://#{gem_repo1}"
gem "rack", "1.0.0"
D

bundle! "package --no-install"
bundle! "update"

expect(the_bundle).to include_gems "rack 1.0.0"
end
end

context "with --all-platforms" do
Expand Down

0 comments on commit 79b479c

Please sign in to comment.