aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Howell2009-10-04 10:15:42 +0100
committerMax Howell2009-10-04 17:49:49 +0100
commit2edb971cd8cb03a63897054ae9f57ba55e24a9d0 (patch)
tree1289f6834f67e09432c2bfd7ba5fde8c32df5040
parentf785369e54b69575f03b1c3cc1050cd0c2c03bc2 (diff)
downloadbrew-2edb971cd8cb03a63897054ae9f57ba55e24a9d0.tar.bz2
Fixes Homebrew/homebrew#78
`brew list` fails after fresh install because Cellar directory doesn't exist yet.
-rwxr-xr-xbin/brew3
1 files changed, 1 insertions, 2 deletions
diff --git a/bin/brew b/bin/brew
index b1d54fdcb..256b2d5f9 100755
--- a/bin/brew
+++ b/bin/brew
@@ -51,14 +51,13 @@ begin
when 'ls', 'list'
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 -= ['Library', 'Cellar', '.git']
Dir.chdir HOMEBREW_PREFIX
exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew )]
elsif ARGV.named_empty?
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?
exec "find", *ARGV.kegs+%w[-not -type d -print]
else