From 0217fb5d9ddbb1ef73e69cd299e591c60afa100b Mon Sep 17 00:00:00 2001 From: Markus Reiter Date: Thu, 6 Jul 2017 20:59:35 +0200 Subject: [PATCH] Also remove directories with `brew cask cleanup`. --- Library/Homebrew/cask/lib/hbc/cli/cleanup.rb | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb index 356162db55..07ac71cd6b 100644 --- a/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb +++ b/Library/Homebrew/cask/lib/hbc/cli/cleanup.rb @@ -79,9 +79,8 @@ module Hbc begin LockFile.new(item.basename).with_lock do puts item - item_size = File.size?(item) - cleanup_size += item_size unless item_size.nil? - item.unlink + cleanup_size += File.size(item) + item.rmtree end rescue OperationInProgressError puts "skipping: #{item} is locked"