upgrade: tweak --dry-run wording.

This commit is contained in:
Mike McQuaid 2019-07-28 14:50:59 +01:00
parent 7f6ef77d0e
commit 41461b2c00
No known key found for this signature in database
GPG Key ID: 48A898132FD8EE70
2 changed files with 6 additions and 6 deletions

View File

@ -33,7 +33,8 @@ module Cask
end
ohai "Casks with `auto_updates` or `version :latest` will not be upgraded" if args.empty? && !greedy?
oh1 "Upgrading #{outdated_casks.count} #{"outdated package".pluralize(outdated_casks.count)}:"
verb = dry_run? ? "Would upgrade" : "Upgrading"
oh1 "#{verb} #{outdated_casks.count} #{"outdated package".pluralize(outdated_casks.count)}:"
caught_exceptions = []
upgradable_casks = outdated_casks.map { |c| [CaskLoader.load(c.installed_caskfile), c] }
@ -41,8 +42,7 @@ module Cask
puts upgradable_casks
.map { |(old_cask, new_cask)| "#{new_cask.full_name} #{old_cask.version} -> #{new_cask.version}" }
.join(", ")
return puts "Dry run: did not upgrade anything." if dry_run?
return if dry_run?
upgradable_casks.each do |(old_cask, new_cask)|
begin

View File

@ -95,7 +95,8 @@ module Homebrew
if formulae_to_install.empty?
oh1 "No packages to upgrade"
else
oh1 "Upgrading #{formulae_to_install.count} outdated #{"package".pluralize(formulae_to_install.count)}:"
verb = args.dry_run? ? "Would upgrade" : "Upgrading"
oh1 "#{verb} #{formulae_to_install.count} outdated #{"package".pluralize(formulae_to_install.count)}:"
formulae_upgrades = formulae_to_install.map do |f|
if f.optlinked?
"#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}"
@ -105,8 +106,7 @@ module Homebrew
end
puts formulae_upgrades.join(", ")
end
return puts "Dry run: did not upgrade anything." if args.dry_run?
return if args.dry_run?
upgrade_formulae(formulae_to_install)