Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show total disk space freed on cleanup. #12970

Merged
merged 1 commit into from
Mar 8, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions Library/Homebrew/cleanup.rb
Original file line number Diff line number Diff line change
Expand Up @@ -363,15 +363,13 @@ def cleanup_path(path)
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

Expand Down