upgrade: put exit statements in both conditional branches

This check was only occurring in one branch of the conditional.
As a result, if you ran `brew upgrade` with no args and there were no packages to upgrade,
the nonsensical message

"==> Upgrading 0 outdated package, with result:"

would be printed.

Closes Homebrew/homebrew#21316.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>
This commit is contained in:
Adam Coffman 2013-07-18 15:18:15 -05:00 committed by Jack Nagel
parent e33d3e1e5c
commit 753adbb0ce

View File

@ -13,6 +13,7 @@ module Homebrew extend self
if ARGV.named.empty?
outdated = Homebrew.outdated_brews
exit 0 if outdated.empty?
else
outdated = ARGV.formulae.select do |f|
if f.installed?