cleanup: clean go_mod_cache

This commit is contained in:
Bo Anderson 2020-07-20 15:30:33 +01:00
parent 84e4e1b449
commit 3205ace13e

View File

@ -15,13 +15,21 @@ module CleanupRefinement
end end
def nested_cache? def nested_cache?
directory? && %w[cargo_cache go_cache glide_home java_cache npm_cache gclient_cache].include?(basename.to_s) directory? && %w[
cargo_cache
go_cache
go_mod_cache
glide_home
java_cache
npm_cache
gclient_cache
].include?(basename.to_s)
end end
def go_cache_directory? def go_cache_directory?
# Go makes its cache contents read-only to ensure cache integrity, # Go makes its cache contents read-only to ensure cache integrity,
# which makes sense but is something we need to undo for cleanup. # which makes sense but is something we need to undo for cleanup.
directory? && %w[go_cache].include?(basename.to_s) directory? && %w[go_cache go_mod_cache].include?(basename.to_s)
end end
def prune?(days) def prune?(days)