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 Homebrew/homebrew#26157. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
This commit is contained in:
parent
8c6c644a6b
commit
5de3686cd2
@ -34,8 +34,12 @@ module Homebrew extend self
|
|||||||
outdated -= pinned
|
outdated -= pinned
|
||||||
end
|
end
|
||||||
|
|
||||||
|
unless outdated.empty?
|
||||||
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
|
oh1 "Upgrading #{outdated.length} outdated package#{outdated.length.plural_s}, with result:"
|
||||||
puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
|
puts outdated.map{ |f| "#{f.name} #{f.version}" } * ", "
|
||||||
|
else
|
||||||
|
oh1 "No packages to upgrade"
|
||||||
|
end
|
||||||
|
|
||||||
unless upgrade_pinned? || pinned.empty?
|
unless upgrade_pinned? || pinned.empty?
|
||||||
oh1 "Not upgrading #{pinned.length} pinned package#{pinned.length.plural_s}:"
|
oh1 "Not upgrading #{pinned.length} pinned package#{pinned.length.plural_s}:"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user