diff options
author | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-28 21:21:56 +0100 |
---|---|---|
committer | David RodrÃguez <deivid.rodriguez@riseup.net> | 2019-03-28 21:21:56 +0100 |
commit | 46a4ee77f555d9d12b76eecc82f5c53305a4e798 (patch) | |
tree | 89e760fd57c650cd9f7c752d5a3fcbcdc49fb6c6 | |
parent | 2167156db020fbe6ce74759cbf62ad1ceb651fb7 (diff) | |
download | bundler-no_install_allows_update_to_install.tar.gz |
Allow `update` to install when `--no-install` usedno_install_allows_update_to_install
The `--no-install` flag flag is only meant for `bundle package`.
-rw-r--r-- | lib/bundler/cli.rb | 4 | ||||
-rw-r--r-- | spec/commands/package_spec.rb | 12 |
2 files changed, 15 insertions, 1 deletions
diff --git a/lib/bundler/cli.rb b/lib/bundler/cli.rb index 3276fac681..00ee591731 100644 --- a/lib/bundler/cli.rb +++ b/lib/bundler/cli.rb @@ -277,7 +277,9 @@ module Bundler def update(*gems) SharedHelpers.major_deprecation(2, "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" diff --git a/spec/commands/package_spec.rb b/spec/commands/package_spec.rb index db8a96005c..7c0c6a86bd 100644 --- a/spec/commands/package_spec.rb +++ b/spec/commands/package_spec.rb @@ -179,6 +179,18 @@ RSpec.describe "bundle package" do 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 |