From 28061369dc4f11b3fcbbf790c95858f53e1c3e21 Mon Sep 17 00:00:00 2001 From: Eric Mark Martin Date: Sun, 9 Sep 2018 00:34:33 -0400 Subject: [PATCH 1/2] Cask: show previous verison in cask upgrade --- Library/Homebrew/cask/cmd/upgrade.rb | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 091f16119dbd5..36a926e6aa011 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -28,7 +28,14 @@ def run ohai "Casks with `auto_updates` or `version :latest` will not be upgraded" if args.empty? && !greedy? oh1 "Upgrading #{Formatter.pluralize(outdated_casks.length, "outdated package")}, with result:" - puts outdated_casks.map { |f| "#{f.full_name} #{f.version}" } * ", " + cask_upgrades = outdated_casks.map do |f| + if f.installed_caskfile.nil? + "#{f.full_name} #{f.version}" + else + "#{f.full_name} #{CaskLoader.load(f.installed_caskfile).version} -> #{f.version}" + end + end + puts cask_upgrades.join(", ") outdated_casks.each do |old_cask| odebug "Started upgrade process for Cask #{old_cask}" From c62d2e691869a9f530e3693e6bb7686b9155e8b7 Mon Sep 17 00:00:00 2001 From: Eric Mark Martin Date: Sun, 9 Sep 2018 13:37:42 -0400 Subject: [PATCH 2/2] Cask: rename block argument f -> cask --- Library/Homebrew/cask/cmd/upgrade.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Library/Homebrew/cask/cmd/upgrade.rb b/Library/Homebrew/cask/cmd/upgrade.rb index 36a926e6aa011..8bab75d85380e 100644 --- a/Library/Homebrew/cask/cmd/upgrade.rb +++ b/Library/Homebrew/cask/cmd/upgrade.rb @@ -28,11 +28,11 @@ def run ohai "Casks with `auto_updates` or `version :latest` will not be upgraded" if args.empty? && !greedy? oh1 "Upgrading #{Formatter.pluralize(outdated_casks.length, "outdated package")}, with result:" - cask_upgrades = outdated_casks.map do |f| - if f.installed_caskfile.nil? - "#{f.full_name} #{f.version}" + cask_upgrades = outdated_casks.map do |cask| + if cask.installed_caskfile.nil? + "#{cask.full_name} #{cask.version}" else - "#{f.full_name} #{CaskLoader.load(f.installed_caskfile).version} -> #{f.version}" + "#{cask.full_name} #{CaskLoader.load(cask.installed_caskfile).version} -> #{cask.version}" end end puts cask_upgrades.join(", ")