Show total disk space freed on cleanup.

This commit is contained in:
Émilia Decaudin 2022-03-07 12:25:27 -05:00
parent ea0ddc3297
commit 6642801b04

View File

@ -363,15 +363,13 @@ module Homebrew
return unless path.exist?
return unless @cleaned_up_paths.add?(path)
disk_usage = path.disk_usage
@disk_cleanup_size += path.disk_usage
if dry_run?
puts "Would remove: #{path} (#{path.abv})"
@disk_cleanup_size += disk_usage
else
puts "Removing: #{path}... (#{path.abv})"
yield
@disk_cleanup_size += disk_usage - path.disk_usage
end
end