diff options
| author | Adam Vandenberg | 2012-11-11 11:39:09 -0800 |
|---|---|---|
| committer | Adam Vandenberg | 2012-11-14 15:10:08 -0800 |
| commit | aecd342a2bb699bf957a5b803bbc75b3edbd2f27 (patch) | |
| tree | f908b20e94671b4b873edb62d2565f67e226c980 /Library/Homebrew | |
| parent | 14cb8c8fce63dba41384ad2f8b8849ef206d8699 (diff) | |
| download | brew-aecd342a2bb699bf957a5b803bbc75b3edbd2f27.tar.bz2 | |
Try to remove a single .DS_Store when uninstalling
Closes Homebrew/homebrew#12976.
Closes Homebrew/homebrew#15975.
Diffstat (limited to 'Library/Homebrew')
| -rw-r--r-- | Library/Homebrew/extend/pathname.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/Library/Homebrew/extend/pathname.rb b/Library/Homebrew/extend/pathname.rb index 0c55e6a6f..d39b21689 100644 --- a/Library/Homebrew/extend/pathname.rb +++ b/Library/Homebrew/extend/pathname.rb @@ -145,6 +145,12 @@ class Pathname rmdir true rescue SystemCallError => e + # OK, maybe there was only a single `.DS_Store` file in that folder + if (self/'.DS_Store').exist? && self.children.length == 1 + (self/'.DS_Store').unlink + retry + end + raise unless e.errno == Errno::ENOTEMPTY::Errno or e.errno == Errno::EACCES::Errno or e.errno == Errno::ENOENT::Errno false end |
