Remove incomplete files in cache on brew cleanup
Closes Homebrew/homebrew#44182. Closes Homebrew/homebrew#44349. Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
parent
9ae6f6d3ac
commit
e0f9994542
@ -57,6 +57,10 @@ module Homebrew
|
|||||||
def cleanup_cache
|
def cleanup_cache
|
||||||
return unless HOMEBREW_CACHE.directory?
|
return unless HOMEBREW_CACHE.directory?
|
||||||
HOMEBREW_CACHE.children.each do |path|
|
HOMEBREW_CACHE.children.each do |path|
|
||||||
|
if path.to_s.end_with? ".incomplete"
|
||||||
|
cleanup_path(path) { path.unlink }
|
||||||
|
next
|
||||||
|
end
|
||||||
if prune?(path)
|
if prune?(path)
|
||||||
if path.file?
|
if path.file?
|
||||||
cleanup_path(path) { path.unlink }
|
cleanup_path(path) { path.unlink }
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user