diff options
author | Rebecca Turner <me@re-becca.org> | 2015-07-01 12:08:11 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2015-07-01 12:08:11 +0300 |
commit | 39789694dca4b37df42cfb78da36534793b7f546 (patch) | |
tree | 47c21a92506bf8a85fa24843de3800ca0105b938 /node_modules/rimraf/bin.js | |
parent | e81376115fc0043e09e11bdb717fe881df2d7434 (diff) |
rimraf@2.4.1
Diffstat (limited to 'node_modules/rimraf/bin.js')
-rwxr-xr-x | node_modules/rimraf/bin.js | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/node_modules/rimraf/bin.js b/node_modules/rimraf/bin.js index 29bfa8a63..1bd5a0d16 100755 --- a/node_modules/rimraf/bin.js +++ b/node_modules/rimraf/bin.js @@ -18,7 +18,7 @@ var args = process.argv.slice(2).filter(function(arg) { if (help || args.length === 0) { // If they didn't ask for help, then this is not a "success" var log = help ? console.log : console.error - log('Usage: rimraf <path>') + log('Usage: rimraf <path> [<path> ...]') log('') log(' Deletes all files and folders at "path" recursively.') log('') @@ -26,8 +26,15 @@ if (help || args.length === 0) { log('') log(' -h, --help Display this usage info') process.exit(help ? 0 : 1) -} else { - args.forEach(function(arg) { - rimraf.sync(arg) +} else + go(0) + +function go (n) { + if (n >= args.length) + return + rimraf(args[n], function (er) { + if (er) + throw er + go(n+1) }) } |