upgrade: tweak --dry-run wording.
This commit is contained in:
parent
7f6ef77d0e
commit
41461b2c00
@ -33,7 +33,8 @@ module Cask
|
|||||||
end
|
end
|
||||||
|
|
||||||
ohai "Casks with `auto_updates` or `version :latest` will not be upgraded" if args.empty? && !greedy?
|
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 = []
|
caught_exceptions = []
|
||||||
|
|
||||||
upgradable_casks = outdated_casks.map { |c| [CaskLoader.load(c.installed_caskfile), c] }
|
upgradable_casks = outdated_casks.map { |c| [CaskLoader.load(c.installed_caskfile), c] }
|
||||||
@ -41,8 +42,7 @@ module Cask
|
|||||||
puts upgradable_casks
|
puts upgradable_casks
|
||||||
.map { |(old_cask, new_cask)| "#{new_cask.full_name} #{old_cask.version} -> #{new_cask.version}" }
|
.map { |(old_cask, new_cask)| "#{new_cask.full_name} #{old_cask.version} -> #{new_cask.version}" }
|
||||||
.join(", ")
|
.join(", ")
|
||||||
|
return if dry_run?
|
||||||
return puts "Dry run: did not upgrade anything." if dry_run?
|
|
||||||
|
|
||||||
upgradable_casks.each do |(old_cask, new_cask)|
|
upgradable_casks.each do |(old_cask, new_cask)|
|
||||||
begin
|
begin
|
||||||
|
|||||||
@ -95,7 +95,8 @@ module Homebrew
|
|||||||
if formulae_to_install.empty?
|
if formulae_to_install.empty?
|
||||||
oh1 "No packages to upgrade"
|
oh1 "No packages to upgrade"
|
||||||
else
|
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|
|
formulae_upgrades = formulae_to_install.map do |f|
|
||||||
if f.optlinked?
|
if f.optlinked?
|
||||||
"#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}"
|
"#{f.full_specified_name} #{Keg.new(f.opt_prefix).version} -> #{f.pkg_version}"
|
||||||
@ -105,8 +106,7 @@ module Homebrew
|
|||||||
end
|
end
|
||||||
puts formulae_upgrades.join(", ")
|
puts formulae_upgrades.join(", ")
|
||||||
end
|
end
|
||||||
|
return if args.dry_run?
|
||||||
return puts "Dry run: did not upgrade anything." if args.dry_run?
|
|
||||||
|
|
||||||
upgrade_formulae(formulae_to_install)
|
upgrade_formulae(formulae_to_install)
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user