diff options
| author | Adam Vandenberg | 2012-11-10 11:26:47 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-11-10 11:26:47 -0800 |
| commit | ff5f3f6b6da9874b79e0f6405778de91839128d0 (patch) | |
| tree | d9cda3e4ca1f6a929ef7455bc37f3a9b8b4ec6bd /Library | |
| parent | e4045fa7e55fb69ffad69ba19e470889684b60d7 (diff) | |
| download | brew-ff5f3f6b6da9874b79e0f6405778de91839128d0.tar.bz2 | |
Exclude the cache from `brew list --unbrewed`
If you have relocated your HOMEBREW_CACHE under HOMEBREW_PREFIX,
then don't show these files as "unbrewed".
Diffstat (limited to 'Library')
| -rw-r--r-- | Library/Homebrew/cmd/list.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/list.rb b/Library/Homebrew/cmd/list.rb index 358df3f4c..50e40c649 100644 --- a/Library/Homebrew/cmd/list.rb +++ b/Library/Homebrew/cmd/list.rb @@ -25,6 +25,11 @@ private def list_unbrewed dirs = HOMEBREW_PREFIX.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s } dirs -= %w[Library Cellar .git] + + # Exclude the cache, if it has been located under the prefix + cache_folder = (HOMEBREW_CACHE.relative_path_from(HOMEBREW_PREFIX)).to_s + dirs -= [cache_folder] + cd HOMEBREW_PREFIX exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew ! -iname brew-man.1 ! -iname brew.1 )] end |
