From db478fb7b2d8047403b71208af73b400bcf7a3e2 Mon Sep 17 00:00:00 2001 From: Uladzislau Shablinski Date: Sun, 2 Oct 2016 12:18:07 +0300 Subject: [PATCH] list: fix exit code for --verbose and --pinned `brew list --verbose ` lists only those kegs that are installed and exits with 0 if all installed. If one or more formulae from 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 --- Library/Homebrew/cmd/list.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index d2eebb5f1b..43a03829e0 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 = {}