`brew list` fails after fresh install because Cellar directory doesn't exist yet.
This commit is contained in:
Max Howell 2009-10-04 10:15:42 +01:00
parent f785369e54
commit 2edb971cd8

View File

@ -51,14 +51,13 @@ begin
when 'ls', 'list' when 'ls', 'list'
if ARGV.flag? '--unbrewed' if ARGV.flag? '--unbrewed'
# Taken from the homebrew wiki (http://wiki.github.com/mxcl/homebrew)
dirs = HOMEBREW_PREFIX.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s } dirs = HOMEBREW_PREFIX.children.select { |pn| pn.directory? }.collect { |pn| pn.basename.to_s }
dirs -= ['Library', 'Cellar', '.git'] dirs -= ['Library', 'Cellar', '.git']
Dir.chdir HOMEBREW_PREFIX Dir.chdir HOMEBREW_PREFIX
exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew )] exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew )]
elsif ARGV.named_empty? elsif ARGV.named_empty?
ENV['CLICOLOR']=nil ENV['CLICOLOR']=nil
exec 'ls', *ARGV.options<<HOMEBREW_CELLAR exec 'ls', *ARGV.options<<HOMEBREW_CELLAR if HOMEBREW_CELLAR.exist?
elsif ARGV.verbose? or not $stdout.tty? elsif ARGV.verbose? or not $stdout.tty?
exec "find", *ARGV.kegs+%w[-not -type d -print] exec "find", *ARGV.kegs+%w[-not -type d -print]
else else