diff --git a/Library/Homebrew/cleanup.rb b/Library/Homebrew/cleanup.rb index 6d36f2c32a..7a1c601100 100644 --- a/Library/Homebrew/cleanup.rb +++ b/Library/Homebrew/cleanup.rb @@ -435,7 +435,12 @@ module Homebrew ] dirs.select(&:directory?) .flat_map { |d| Pathname.glob("#{d}/**/.DS_Store") } - .each(&:unlink) + .each do |dir| + dir.unlink + rescue Errno::EACCES + # don't care if we can't delete a .DS_Store + nil + end end def prune_prefix_symlinks_and_directories