diff options
| author | Mike McQuaid | 2018-02-12 08:53:11 +0000 |
|---|---|---|
| committer | GitHub | 2018-02-12 08:53:11 +0000 |
| commit | 8c98317dc7ea5d1320967831267e40922c434eaf (patch) | |
| tree | b0f8b2d974a2bfda965965edf5070adc4ab5bad6 | |
| parent | adfd3dbe161a5dc963134d5c0b798ed23e5f3a5c (diff) | |
| parent | f97d8e3905f4ede7403be512df4aaeccc59147be (diff) | |
| download | brew-8c98317dc7ea5d1320967831267e40922c434eaf.tar.bz2 | |
Merge pull request #3783 from DomT4/cache_size
diagnostic: implement cache size check
| -rw-r--r-- | Library/Homebrew/diagnostic.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Library/Homebrew/diagnostic.rb b/Library/Homebrew/diagnostic.rb index dbd6aa0c1..cc364eaaa 100644 --- a/Library/Homebrew/diagnostic.rb +++ b/Library/Homebrew/diagnostic.rb @@ -835,6 +835,17 @@ module Homebrew EOS 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 # Other frameworks that are known to cause problems when present frameworks_to_check = %w[ |
