diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 93f81b2d89..61f8fb4d44 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -9,7 +9,7 @@ module CleanupRefinement end def nested_cache? - directory? && ["glide_home", "java_cache", "npm_cache"].include?(basename.to_s) + directory? && %w[glide_home java_cache npm_cache gclient_cache].include?(basename.to_s) end def prune?(days) diff --git a/Library/Homebrew/test/cleanup_spec.rb b/Library/Homebrew/test/cleanup_spec.rb index a04fec2641..381645eaff 100644 --- a/Library/Homebrew/test/cleanup_spec.rb +++ b/Library/Homebrew/test/cleanup_spec.rb @@ -197,6 +197,15 @@ describe Homebrew::Cleanup do expect(npm_cache).not_to exist end + it "cleans up 'gclient_cache'" do + gclient_cache = (HOMEBREW_CACHE/"gclient_cache") + gclient_cache.mkpath + + subject.cleanup_cache + + expect(gclient_cache).not_to exist + end + it "cleans up all files and directories" do git = (HOMEBREW_CACHE/"gist--git") gist = (HOMEBREW_CACHE/"gist")