rimraf 2.4.0 → 2.4.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 (4) hide show
  1. package/README.md +10 -3
  2. package/bin.js +11 -4
  3. package/package.json +6 -6
  4. package/rimraf.js +1 -1
package/README.md CHANGED
@@ -1,10 +1,17 @@
1
- The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
1
+ [![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)
2
+
3
+ The [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.
2
4
 
3
5
  Install with `npm install rimraf`, or just drop rimraf.js somewhere.
4
6
 
5
7
  ## API
6
8
 
7
- `rimraf(f, callback)`
9
+ `rimraf(f, [opts], callback)`
10
+
11
+ The first parameter will be interpreted as a globbing pattern for files. If you
12
+ want to disable globbing you can do so with `opts.disableGlob` (defaults to
13
+ `false`). This might be handy, for instance, if you have filenames that contain
14
+ globbing wildcard characters.
8
15
 
9
16
  The callback will be called with an error if there is one. Certain
10
17
  errors are handled for you:
@@ -28,7 +35,7 @@ the async API. It's better.
28
35
  ## CLI
29
36
 
30
37
  If installed with `npm install rimraf -g` it can be used as a global
31
- command `rimraf <path>` which is useful for cross platform support.
38
+ command `rimraf <path> [<path> ...]` which is useful for cross platform support.
32
39
 
33
40
  ## mkdirp
34
41
 
package/bin.js CHANGED
@@ -18,7 +18,7 @@ var args = process.argv.slice(2).filter(function(arg) {
18
18
  if (help || args.length === 0) {
19
19
  // If they didn't ask for help, then this is not a "success"
20
20
  var log = help ? console.log : console.error
21
- log('Usage: rimraf <path>')
21
+ log('Usage: rimraf <path> [<path> ...]')
22
22
  log('')
23
23
  log(' Deletes all files and folders at "path" recursively.')
24
24
  log('')
@@ -26,8 +26,15 @@ if (help || args.length === 0) {
26
26
  log('')
27
27
  log(' -h, --help Display this usage info')
28
28
  process.exit(help ? 0 : 1)
29
- } else {
30
- args.forEach(function(arg) {
31
- rimraf.sync(arg)
29
+ } else
30
+ go(0)
31
+
32
+ function go (n) {
33
+ if (n >= args.length)
34
+ return
35
+ rimraf(args[n], function (er) {
36
+ if (er)
37
+ throw er
38
+ go(n+1)
32
39
  })
33
40
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rimraf",
3
- "version": "2.4.0",
3
+ "version": "2.4.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,16 +11,16 @@
11
11
  },
12
12
  "bin": "./bin.js",
13
13
  "dependencies": {
14
- "glob": "^4.4.2"
14
+ "glob": "^5.0.14"
15
15
  },
16
16
  "files": [
17
- "bin.js",
18
- "rimraf.js",
19
17
  "LICENSE",
20
- "README.md"
18
+ "README.md",
19
+ "bin.js",
20
+ "rimraf.js"
21
21
  ],
22
22
  "devDependencies": {
23
23
  "mkdirp": "^0.5.1",
24
- "tap": "^1.2.0"
24
+ "tap": "^1.3.1"
25
25
  }
26
26
  }
package/rimraf.js CHANGED
@@ -83,7 +83,7 @@ function rimraf (p, options, cb) {
83
83
  results.forEach(function (p) {
84
84
  rimraf_(p, options, function CB (er) {
85
85
  if (er) {
86
- if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") &&
86
+ if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY" || er.code === "EPERM") &&
87
87
  busyTries < options.maxBusyTries) {
88
88
  busyTries ++
89
89
  var time = busyTries * 100