Skip to content

Commit 94eeefb

Browse files
committed
Add more helpful message for bundle upgrade
1 parent 07bf217 commit 94eeefb

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

bundler/lib/bundler/cli.rb

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,12 @@ def help(cli = nil)
185185
end
186186

187187
def self.handle_no_command_error(command, has_namespace = $thor_runner)
188+
if command == "upgrade"
189+
command = Bundler.ui.add_color("bundle update <gem_name>", :bold, :cyan)
190+
Bundler.ui.info("Please use #{command} to update gems in your bundle.")
191+
return
192+
end
193+
188194
if Bundler.settings[:plugins] && Bundler::Plugin.command?(command)
189195
return Bundler::Plugin.exec_command(command, ARGV[1..-1])
190196
end

bundler/spec/other/cli_dispatch_spec.rb

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,4 +17,9 @@
1717
bundle "in", raise_on_error: false
1818
expect(err).to eq("Ambiguous command in matches [info, init, install]")
1919
end
20+
21+
it "prints a helpful message for 'upgrade'" do
22+
bundle "upgrade", raise_on_error: false
23+
expect(out).to eq("bundle update")
24+
end
2025
end

0 commit comments

Comments
 (0)