Skip to content

Commit

Permalink
list: fix exit code for --verbose and --pinned
Browse files Browse the repository at this point in the history
`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
  • Loading branch information
vladshablinsky committed Oct 2, 2016
1 parent 4b5aac0 commit db478fb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Library/Homebrew/cmd/list.rb
Expand Up @@ -106,7 +106,11 @@ def filtered_list
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 = {}
Expand Down

0 comments on commit db478fb

Please sign in to comment.