rimraf 2.1.3 → 2.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/rimraf.js +2 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimraf",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "main": "rimraf.js",
5
5
  "description": "A deep deletion module for node (like `rm -rf`)",
6
6
  "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
package/rimraf.js CHANGED
@@ -69,11 +69,11 @@ function rimraf_ (p, cb) {
69
69
  }
70
70
 
71
71
  function rmdir (p, originalEr, cb) {
72
- // try to rmdir first, and only readdir on ENOTEMPTY
72
+ // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS)
73
73
  // if we guessed wrong, and it's not a directory, then
74
74
  // raise the original error.
75
75
  fs.rmdir(p, function (er) {
76
- if (er && er.code === "ENOTEMPTY")
76
+ if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST"))
77
77
  rmkids(p, cb)
78
78
  else if (er && er.code === "ENOTDIR")
79
79
  cb(originalEr)