rimraf 2.5.0 → 2.5.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.
- package/README.md +1 -1
- package/package.json +3 -3
- package/rimraf.js +12 -4
package/README.md
CHANGED
|
@@ -29,7 +29,7 @@ errors are handled for you:
|
|
|
29
29
|
|
|
30
30
|
## options
|
|
31
31
|
|
|
32
|
-
* unlink, chmod, stat, lstat, rmdir, readdir
|
|
32
|
+
* unlink, chmod, stat, lstat, rmdir, readdir,
|
|
33
33
|
unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
|
|
34
34
|
|
|
35
35
|
In order to use a custom file system library, you can override
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimraf",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.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/)",
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
},
|
|
12
12
|
"bin": "./bin.js",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"glob": "^
|
|
14
|
+
"glob": "^7.0.5"
|
|
15
15
|
},
|
|
16
16
|
"files": [
|
|
17
17
|
"LICENSE",
|
|
@@ -21,6 +21,6 @@
|
|
|
21
21
|
],
|
|
22
22
|
"devDependencies": {
|
|
23
23
|
"mkdirp": "^0.5.1",
|
|
24
|
-
"tap": "^
|
|
24
|
+
"tap": "^6.1.1"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/rimraf.js
CHANGED
|
@@ -48,9 +48,9 @@ function rimraf (p, options, cb) {
|
|
|
48
48
|
|
|
49
49
|
assert(p, 'rimraf: missing path')
|
|
50
50
|
assert.equal(typeof p, 'string', 'rimraf: path should be a string')
|
|
51
|
-
assert(options, 'rimraf: missing options')
|
|
52
|
-
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
|
53
51
|
assert.equal(typeof cb, 'function', 'rimraf: callback function required')
|
|
52
|
+
assert(options, 'rimraf: invalid options argument provided')
|
|
53
|
+
assert.equal(typeof options, 'object', 'rimraf: options should be object')
|
|
54
54
|
|
|
55
55
|
defaults(options)
|
|
56
56
|
|
|
@@ -61,7 +61,7 @@ function rimraf (p, options, cb) {
|
|
|
61
61
|
if (options.disableGlob || !glob.hasMagic(p))
|
|
62
62
|
return afterGlob(null, [p])
|
|
63
63
|
|
|
64
|
-
|
|
64
|
+
options.lstat(p, function (er, stat) {
|
|
65
65
|
if (!er)
|
|
66
66
|
return afterGlob(null, [p])
|
|
67
67
|
|
|
@@ -135,6 +135,10 @@ function rimraf_ (p, options, cb) {
|
|
|
135
135
|
if (er && er.code === "ENOENT")
|
|
136
136
|
return cb(null)
|
|
137
137
|
|
|
138
|
+
// Windows can EPERM on stat. Life is suffering.
|
|
139
|
+
if (er && er.code === "EPERM" && isWindows)
|
|
140
|
+
fixWinEPERM(p, options, er, cb)
|
|
141
|
+
|
|
138
142
|
if (st && st.isDirectory())
|
|
139
143
|
return rmdir(p, options, er, cb)
|
|
140
144
|
|
|
@@ -269,7 +273,7 @@ function rimrafSync (p, options) {
|
|
|
269
273
|
results = [p]
|
|
270
274
|
} else {
|
|
271
275
|
try {
|
|
272
|
-
|
|
276
|
+
options.lstatSync(p)
|
|
273
277
|
results = [p]
|
|
274
278
|
} catch (er) {
|
|
275
279
|
results = glob.sync(p, options.glob)
|
|
@@ -287,6 +291,10 @@ function rimrafSync (p, options) {
|
|
|
287
291
|
} catch (er) {
|
|
288
292
|
if (er.code === "ENOENT")
|
|
289
293
|
return
|
|
294
|
+
|
|
295
|
+
// Windows can EPERM on stat. Life is suffering.
|
|
296
|
+
if (er.code === "EPERM" && isWindows)
|
|
297
|
+
fixWinEPERMSync(p, options, er)
|
|
290
298
|
}
|
|
291
299
|
|
|
292
300
|
try {
|