Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2015-07-01 12:08:11 +0300
committerRebecca Turner <me@re-becca.org>2015-07-01 12:08:11 +0300
commit39789694dca4b37df42cfb78da36534793b7f546 (patch)
tree47c21a92506bf8a85fa24843de3800ca0105b938 /node_modules/rimraf/bin.js
parente81376115fc0043e09e11bdb717fe881df2d7434 (diff)
rimraf@2.4.1
Diffstat (limited to 'node_modules/rimraf/bin.js')
-rwxr-xr-xnode_modules/rimraf/bin.js15
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)
})
}