Merge pull request #3783 from DomT4/cache_size

diagnostic: implement cache size check
This commit is contained in:
Mike McQuaid 2018-02-12 08:53:11 +00:00 committed by GitHub
commit 8c98317dc7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -835,6 +835,17 @@ module Homebrew
EOS EOS
end end
def check_for_large_cache
return unless HOMEBREW_CACHE.exist?
return if ENV["CI"] # CI can be expected to have a large cache.
cache_size = HOMEBREW_CACHE.disk_usage
return unless cache_size > 2_147_483_648
<<~EOS
Your HOMEBREW_CACHE is using #{disk_usage_readable(cache_size)} of disk space.
You may wish to consider running `brew cleanup`.
EOS
end
def check_for_other_frameworks def check_for_other_frameworks
# Other frameworks that are known to cause problems when present # Other frameworks that are known to cause problems when present
frameworks_to_check = %w[ frameworks_to_check = %w[