aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorFrizlab2014-01-25 06:30:46 +0100
committerMike McQuaid2014-01-26 18:04:20 +0100
commit222864afc848dfce1ee4255b08bcd1f667b26854 (patch)
treea801b1075aaa97923ad44638f34c53f16891cb60 /Library
parent406d954664c33e2a23e8e95f016f644e66829ef4 (diff)
downloadhomebrew-222864afc848dfce1ee4255b08bcd1f667b26854.tar.bz2
upgrade: fix output when no packages to upgrade.
When upgrading, if the only package to upgrade is a pinned package, the output looked like that: ==> Upgrading 0 packages, with result: ==> Not upgrading 1 pinned package: <<package_name & version>> The blank line is not beautiful. This commit fixes the output and replaces with: ==> No packages to upgrade ==> Not upgrading 1 pinned package: <<package_name & version>> Closes #26157. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/upgrade.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/Library/Homebrew/cmd/upgrade.rb b/Library/Homebrew/cmd/upgrade.rb
index ed3529e98..a68830a94 100644
--- a/Library/Homebrew/cmd/upgrade.rb
+++ b/Library/Homebrew/cmd/upgrade.rb
@@ -34,8 +34,12 @@ module Homebrew extend self
outdated -= pinned
end
- oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
- puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
+ unless outdated.empty?
+ oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
+ puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
+ else
+ oh1 "No packages to upgrade"
+ end
unless upgrade_pinned? || pinned.empty?
oh1 "Not upgrading #{pinned.length} pinned package#{pinned.length.plural_s}:"