Skip to content
This repository was archived by the owner on Apr 14, 2021. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions lib/bundler/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,16 @@ def auto_install
def print_command
return unless ENV["BUNDLE_POSTIT_TRAMPOLINING_VERSION"] || Bundler.ui.debug?
_, _, config = @_initializer
current_command = config[:current_command].name
return if %w[exec version check platform show help].include?(current_command)
command = ["bundle", current_command] + args
command << Thor::Options.to_switches(options)
current_command = config[:current_command]
command_name = current_command.name
return if %w[exec version check platform show help].include?(command_name)
command = ["bundle", command_name] + args
options_to_print = options.dup
options_to_print.delete_if do |k, v|
next unless o = current_command.options[k]
o.default == v
end
command << Thor::Options.to_switches(options_to_print.sort_by(&:first)).strip
command.reject!(&:empty?)
Bundler.ui.info "Running `#{command * " "}` with bundler #{Bundler::VERSION}"
end
Expand Down
5 changes: 5 additions & 0 deletions spec/bundler/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,11 @@
bundle! "config", :verbose => true
expect(out).to start_with("Running `bundle config --verbose` with bundler #{Bundler::VERSION}")
end

it "doesn't print defaults" do
install_gemfile! "", :verbose => true
expect(out).to start_with("Running `bundle install --no-color --retry 0 --verbose` with bundler #{Bundler::VERSION}")
end
end

describe "printing the outdated warning" do
Expand Down