aboutsummaryrefslogtreecommitdiffstats
path: root/Library
diff options
context:
space:
mode:
authorDominyk Tiller2018-02-10 09:05:06 +0000
committerDominyk Tiller2018-02-11 17:05:13 +0000
commitf97d8e3905f4ede7403be512df4aaeccc59147be (patch)
treebf4b9814e1a97b8491c50fc9196c7b4abcc8f54d /Library
parent021fe22e3c982b08346422d1e7897e929a709380 (diff)
downloadbrew-f97d8e3905f4ede7403be512df4aaeccc59147be.tar.bz2
diagnostic: implement cache size check
Diffstat (limited to 'Library')
-rw-r--r--Library/Homebrew/diagnostic.rb11
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[