rimraf 2.6.1 → 2.7.1
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/package.json +6 -3
- package/rimraf.js +12 -3
package/package.json
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rimraf",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.7.1",
|
|
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/)",
|
|
7
7
|
"license": "ISC",
|
|
8
8
|
"repository": "git://github.com/isaacs/rimraf.git",
|
|
9
9
|
"scripts": {
|
|
10
|
+
"preversion": "npm test",
|
|
11
|
+
"postversion": "npm publish",
|
|
12
|
+
"postpublish": "git push origin --all; git push origin --tags",
|
|
10
13
|
"test": "tap test/*.js"
|
|
11
14
|
},
|
|
12
15
|
"bin": "./bin.js",
|
|
13
16
|
"dependencies": {
|
|
14
|
-
"glob": "^7.
|
|
17
|
+
"glob": "^7.1.3"
|
|
15
18
|
},
|
|
16
19
|
"files": [
|
|
17
20
|
"LICENSE",
|
|
@@ -21,6 +24,6 @@
|
|
|
21
24
|
],
|
|
22
25
|
"devDependencies": {
|
|
23
26
|
"mkdirp": "^0.5.1",
|
|
24
|
-
"tap": "^
|
|
27
|
+
"tap": "^12.1.1"
|
|
25
28
|
}
|
|
26
29
|
}
|
package/rimraf.js
CHANGED
|
@@ -4,7 +4,13 @@ rimraf.sync = rimrafSync
|
|
|
4
4
|
var assert = require("assert")
|
|
5
5
|
var path = require("path")
|
|
6
6
|
var fs = require("fs")
|
|
7
|
-
var glob =
|
|
7
|
+
var glob = undefined
|
|
8
|
+
try {
|
|
9
|
+
glob = require("glob")
|
|
10
|
+
} catch (_err) {
|
|
11
|
+
// treat glob as optional.
|
|
12
|
+
}
|
|
13
|
+
var _0666 = parseInt('666', 8)
|
|
8
14
|
|
|
9
15
|
var defaultGlobOpts = {
|
|
10
16
|
nosort: true,
|
|
@@ -36,6 +42,9 @@ function defaults (options) {
|
|
|
36
42
|
if (options.glob === false) {
|
|
37
43
|
options.disableGlob = true
|
|
38
44
|
}
|
|
45
|
+
if (options.disableGlob !== true && glob === undefined) {
|
|
46
|
+
throw Error('glob dependency not found, set `options.disableGlob = true` if intentional')
|
|
47
|
+
}
|
|
39
48
|
options.disableGlob = options.disableGlob || false
|
|
40
49
|
options.glob = options.glob || defaultGlobOpts
|
|
41
50
|
}
|
|
@@ -165,7 +174,7 @@ function fixWinEPERM (p, options, er, cb) {
|
|
|
165
174
|
if (er)
|
|
166
175
|
assert(er instanceof Error)
|
|
167
176
|
|
|
168
|
-
options.chmod(p,
|
|
177
|
+
options.chmod(p, _0666, function (er2) {
|
|
169
178
|
if (er2)
|
|
170
179
|
cb(er2.code === "ENOENT" ? null : er)
|
|
171
180
|
else
|
|
@@ -187,7 +196,7 @@ function fixWinEPERMSync (p, options, er) {
|
|
|
187
196
|
assert(er instanceof Error)
|
|
188
197
|
|
|
189
198
|
try {
|
|
190
|
-
options.chmodSync(p,
|
|
199
|
+
options.chmodSync(p, _0666)
|
|
191
200
|
} catch (er2) {
|
|
192
201
|
if (er2.code === "ENOENT")
|
|
193
202
|
return
|