aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorMike McQuaid2014-08-01 17:45:37 +0200
committerMike McQuaid2014-08-01 17:46:05 +0200
commitf617bc3d1565509dcd611725b104284271dc936d (patch)
tree69463b5f206062734096eb4b163db9c84ef1812d /Library
parent511d8a7053cd7329e831e97ecc4edfa317f09c9e (diff)
downloadhomebrew-f617bc3d1565509dcd611725b104284271dc936d.tar.bz2
outdated: allow passing formulae as arguments.
If formulae names are passed as arguments check if just they are outdated. Additionally, return a failed code if they are outdated. This will hopefully be able to stop people complaining about the outdated error code as they can now just run e.g.: `brew outdated git && brew upgrade git` Closes #31242. Signed-off-by: Mike McQuaid <mike@mikemcquaid.com>
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/cmd/outdated.rb4
1 files changed, 3 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/outdated.rb b/Library/Homebrew/cmd/outdated.rb
index d13e7d0c6..f90e933f3 100644
--- a/Library/Homebrew/cmd/outdated.rb
+++ b/Library/Homebrew/cmd/outdated.rb
@@ -10,10 +10,12 @@ module Homebrew
puts f.name
end
end
+ Homebrew.failed = ARGV.formulae.any? && outdated_brews.any?
end
def outdated_brews
- Formula.installed.map do |f|
+ brews = ARGV.formulae.any? ? ARGV.formulae : Formula.installed
+ brews.map do |f|
versions = f.rack.subdirs.map { |d| Keg.new(d).version }.sort!
if versions.all? { |version| f.pkg_version > version }
yield f, versions if block_given?