brew list: check for Cellar

If the Cellar doesn't exist yet, don't print an error message or exit
with an error status.

Fixes Homebrew/homebrew#14503.
This commit is contained in:
Adam Vandenberg 2012-08-28 10:52:51 -07:00
parent 396ca3fc59
commit 516041dba8

View File

@ -1,5 +1,8 @@
module Homebrew extend self
def list
# Cellar doesn't until the first formula is installed.
return unless HOMEBREW_CELLAR.exist?
if ARGV.flag? '--unbrewed'
dirs = HOMEBREW_PREFIX.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s }
dirs -= %w[Library Cellar .git]