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".
This commit is contained in:
parent
e4045fa7e5
commit
ff5f3f6b6d
@ -25,6 +25,11 @@ private
|
|||||||
def list_unbrewed
|
def list_unbrewed
|
||||||
dirs = HOMEBREW_PREFIX.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s }
|
dirs = HOMEBREW_PREFIX.children.select{ |pn| pn.directory? }.map{ |pn| pn.basename.to_s }
|
||||||
dirs -= %w[Library Cellar .git]
|
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
|
cd HOMEBREW_PREFIX
|
||||||
exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew ! -iname brew-man.1 ! -iname brew.1 )]
|
exec 'find', *dirs + %w[-type f ( ! -iname .ds_store ! -iname brew ! -iname brew-man.1 ! -iname brew.1 )]
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user