aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd/list.rb
diff options
context:
space:
mode:
authorUladzislau Shablinski2016-10-02 12:18:07 +0300
committerUladzislau Shablinski2016-10-02 12:35:30 +0300
commitdb478fb7b2d8047403b71208af73b400bcf7a3e2 (patch)
tree23c4901abd041d63c06b46a0404bcb5ce3bfc181 /Library/Homebrew/cmd/list.rb
parent4b5aac07f044e684d7c544ec401212606151784b (diff)
downloadbrew-db478fb7b2d8047403b71208af73b400bcf7a3e2.tar.bz2
list: fix exit code for --verbose and --pinned
`brew list --verbose <formulae>` lists only those kegs that are installed and exits with 0 if all <formulae> installed. If one or more formulae from <formulae> are not installed, the command lists only installed versions and exits with 1. `brew --pinned formula` exits with 1 if formula is not pinned. Fixes #1172
Diffstat (limited to 'Library/Homebrew/cmd/list.rb')
-rw-r--r--Library/Homebrew/cmd/list.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb
index d2eebb5f1..43a03829e 100644
--- a/Library/Homebrew/cmd/list.rb
+++ b/Library/Homebrew/cmd/list.rb
@@ -106,7 +106,11 @@ module Homebrew
names = if ARGV.named.empty?
Formula.racks
else
- ARGV.named.map { |n| HOMEBREW_CELLAR+n }.select(&:exist?)
+ racks = ARGV.named.map { |n| HOMEBREW_CELLAR+n }
+ racks.select do |rack|
+ Homebrew.failed = true unless rack.exist?
+ rack.exist?
+ end
end
if ARGV.include? "--pinned"
pinned_versions = {}