diff options
author | Samuel Giddins <segiddins@segiddins.me> | 2017-07-08 17:35:15 -0500 |
---|---|---|
committer | Samuel Giddins <segiddins@segiddins.me> | 2017-07-12 15:09:55 -0500 |
commit | b5f9e10b53a829e3471492bae7b87c43d60de4f4 (patch) | |
tree | 0360efcf4e165166c4cce93f4f71fceae280acae /lib/bundler/cli | |
parent | 6b2d04b892dfa9ac9b93d4cba80d59195d71449f (diff) | |
download | bundler-b5f9e10b53a829e3471492bae7b87c43d60de4f4.tar.gz |
Fix deployment specs under 2.0
Diffstat (limited to 'lib/bundler/cli')
-rw-r--r-- | lib/bundler/cli/install.rb | 8 | ||||
-rw-r--r-- | lib/bundler/cli/outdated.rb | 18 |
2 files changed, 18 insertions, 8 deletions
diff --git a/lib/bundler/cli/install.rb b/lib/bundler/cli/install.rb index 3ff3438baf..35a0aa7b58 100644 --- a/lib/bundler/cli/install.rb +++ b/lib/bundler/cli/install.rb @@ -44,7 +44,11 @@ module Bundler options[:local] = true if Bundler.app_cache.exist? - Bundler.settings[:frozen] = true unless Bundler.feature_flag.deployment_means_frozen? + if Bundler.feature_flag.deployment_means_frozen? + Bundler.settings.temporary(:deployment => true) + else + Bundler.settings[:frozen] ||= true + end end # When install is called with --no-deployment, disable deployment mode @@ -177,7 +181,7 @@ module Bundler def normalize_settings Bundler.settings[:path] = nil if options[:system] - Bundler.settings[:path] = "vendor/bundle" if options[:deployment] && !Bundler.feature_flag.deployment_means_frozen? + Bundler.settings[:path] = "vendor/bundle" if options[:deployment] Bundler.settings[:path] = options["path"] if options["path"] Bundler.settings[:path] ||= "bundle" if options["standalone"] diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 20d6ed01fa..07e17df981 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -214,13 +214,19 @@ module Bundler end def check_for_deployment_mode - if Bundler.frozen? - raise ProductionError, "You are trying to check outdated gems in " \ - "deployment mode. Run `bundle outdated` elsewhere.\n" \ - "\nIf this is a development machine, remove the " \ - "#{Bundler.default_gemfile} freeze" \ - "\nby running `bundle install --no-deployment`." + return unless Bundler.frozen? + suggested_command = if Bundler.settings.locations("frozen")[:global] + "bundle config --delete frozen" + elsif Bundler.settings.locations("deployment").keys.&([:global, :local]).any? + "bundle config --delete deployment" + else + "bundle install --no-deployment" end + raise ProductionError, "You are trying to check outdated gems in " \ + "deployment mode. Run `bundle outdated` elsewhere.\n" \ + "\nIf this is a development machine, remove the " \ + "#{Bundler.default_gemfile} freeze" \ + "\nby running `#{suggested_command}`." end def update_present_via_semver_portions(current_spec, active_spec, options) |