diff options
Diffstat (limited to 'lib/bundler/cli/outdated.rb')
-rw-r--r-- | lib/bundler/cli/outdated.rb | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/bundler/cli/outdated.rb b/lib/bundler/cli/outdated.rb index 863d0dd388..5125cc710b 100644 --- a/lib/bundler/cli/outdated.rb +++ b/lib/bundler/cli/outdated.rb @@ -1,5 +1,4 @@ # frozen_string_literal: true -require "bundler/cli/common" module Bundler class CLI::Outdated @@ -46,7 +45,7 @@ module Bundler Bundler::CLI::Common.patch_level_options(options).any? filter_options_patch = options.keys & - %w(filter-major filter-minor filter-patch) + %w[filter-major filter-minor filter-patch] definition_resolution = proc do options[:local] ? definition.resolve_with_cache! : definition.resolve_remotely! @@ -214,13 +213,19 @@ module Bundler end def check_for_deployment_mode - if Bundler.settings[: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) |