diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index fc3554def1..47ef774cdc 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -209,6 +209,7 @@ module Homebrew return if periodic cleanup_portable_ruby + cleanup_bootsnap else args.each do |arg| formula = begin @@ -399,6 +400,17 @@ module Homebrew FileUtils.rm_rf portable_rubies_to_remove end + def cleanup_bootsnap + bootsnap = cache/"bootsnap" + return unless bootsnap.exist? + + if dry_run? + puts "Would remove: #{bootsnap} (#{bootsnap.abv})" + else + FileUtils.rm_rf bootsnap + end + end + def cleanup_cache_db(rack = nil) FileUtils.rm_rf [ cache/"desc_cache.json",