test-bot: cleanup bottle files in cache

Closes Homebrew/homebrew#45637.

Signed-off-by: Xu Cheng <xucheng@me.com>
This commit is contained in:
Xu Cheng 2015-11-04 14:36:44 +08:00
parent 20d38701b5
commit ec114bb480

View File

@ -1018,7 +1018,14 @@ module Homebrew
end
end
ensure
HOMEBREW_CACHE.children.each(&:rmtree) if ARGV.include? "--clean-cache"
if ARGV.include? "--clean-cache"
HOMEBREW_CACHE.children.each(&:rmtree)
else
Dir.glob("*.bottle*.tar.gz") do |bottle_file|
FileUtils.rm_f HOMEBREW_CACHE/bottle_file
end
end
Homebrew.failed = any_errors
end
end