summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDennis Suratna <dennis.suratna@gmail.com>2017-03-06 10:23:42 -0800
committerDennis Suratna <dennis.suratna@gmail.com>2017-03-06 11:52:06 -0800
commit8e8fc90ddce73ccaea3227e622bfe13e6f56ab41 (patch)
tree978e9514337697d05662b80bfdc88bf94b6f18e0
parent1b9d5cae04facdee2b3d3244e11d3edf5337c56c (diff)
downloadbundler-8e8fc90ddce73ccaea3227e622bfe13e6f56ab41.tar.gz
Suggest different command depending on where 'frozen' config is set
-rw-r--r--lib/bundler/definition.rb4
-rw-r--r--spec/commands/update_spec.rb8
2 files changed, 11 insertions, 1 deletions
diff --git a/lib/bundler/definition.rb b/lib/bundler/definition.rb
index bf3c34d9ff..8e8897df02 100644
--- a/lib/bundler/definition.rb
+++ b/lib/bundler/definition.rb
@@ -409,8 +409,10 @@ module Bundler
"updated #{Bundler.default_lockfile.relative_path_from(SharedHelpers.pwd)} to version control."
unless explicit_flag
+
+ suggested_command = Bundler.settings.locations("frozen")[:global] == "1" ? "bundle config --delete frozen" : "bundle install --no-deployment"
msg << "\n\nIf this is a development machine, remove the #{Bundler.default_gemfile} " \
- "freeze \nby running `bundle install --no-deployment`."
+ "freeze \nby running `#{suggested_command}`."
end
added = []
diff --git a/spec/commands/update_spec.rb b/spec/commands/update_spec.rb
index bb24c501e9..4992e428da 100644
--- a/spec/commands/update_spec.rb
+++ b/spec/commands/update_spec.rb
@@ -159,8 +159,16 @@ RSpec.describe "bundle update" do
bundle "update"
expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
+ expect(out).to match(/freeze \nby running `bundle install --no-deployment`./m)
expect(exitstatus).not_to eq(0) if exitstatus
end
+
+ it "should suggest different command when frozen is set globally" do
+ bundler "config --global frozen 1"
+ bundle "update"
+ expect(out).to match(/You are trying to install in deployment mode after changing.your Gemfile/m)
+ expect(out).to match(/freeze \nby running `bundle config --delete frozen`./m)
+ end
end
describe "with --source option" do