Try to remove a single .DS_Store when uninstalling
Closes Homebrew/homebrew#12976. Closes Homebrew/homebrew#15975.
This commit is contained in:
parent
14cb8c8fce
commit
aecd342a2b
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user