aboutsummaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorMax Howell2009-09-29 21:17:44 +0100
committerMax Howell2009-09-30 18:11:49 +0100
commitc61d96529c25d19b71e33eb293491553b587bcf8 (patch)
tree9700be1eb461f537dd3cbac9444d443b5c6ab3a5 /bin
parente4a32736cd72836f3948ea4dd5f5aa97a784ff69 (diff)
downloadbrew-c61d96529c25d19b71e33eb293491553b587bcf8.tar.bz2
brew list --unbrewed fix
Determine all directories that aren't Homebrew ones. Exec find. I prefer to keep short stuff in bin/brew so people reading the code have a better idea of what happens, and what sort of functions are useful for the sorts of things we do with Homebrew.
Diffstat (limited to 'bin')
-rwxr-xr-xbin/brew6
1 files changed, 5 insertions, 1 deletions
diff --git a/bin/brew b/bin/brew
index b3a1a3c82..60496dd54 100755
--- a/bin/brew
+++ b/bin/brew
@@ -40,7 +40,11 @@ begin
when 'ls', 'list'
if ARGV.flag? '--unbrewed'
- puts unbrewed_files
+ # 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