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:
authorisaacs <i@izs.me>2012-06-09 02:15:40 +0400
committerisaacs <i@izs.me>2012-06-09 02:15:40 +0400
commite832e71c0d959eee7473e1f1eeebbfa7b0638738 (patch)
treed1320e30d14745f04281dc45e238413c8609ad7a /node_modules/rimraf/rimraf.js
parent636a58720df364a88e8fe8ed2afc780239d320dc (diff)
Upgrade rimraf
Diffstat (limited to 'node_modules/rimraf/rimraf.js')
-rw-r--r--node_modules/rimraf/rimraf.js16
1 files changed, 12 insertions, 4 deletions
diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js
index 67d018ab4..bb1bb8cc2 100644
--- a/node_modules/rimraf/rimraf.js
+++ b/node_modules/rimraf/rimraf.js
@@ -11,8 +11,16 @@ try {
fs = require("fs")
}
-var lstat = process.platform === "win32" ? "stat" : "lstat"
- , lstatSync = lstat + "Sync"
+var lstat = "lstat"
+if (process.platform === "win32") {
+ // not reliable on windows prior to 0.7.9
+ var v = process.version.replace(/^v/, '').split(/\.|-/).map(Number)
+ if (v[0] === 0 && (v[1] < 7 || v[1] == 7 && v[2] < 9)) {
+ lstat = "stat"
+ }
+}
+if (!fs[lstat]) lstat = "stat"
+var lstatSync = lstat + "Sync"
// for EMFILE handling
var timeout = 0
@@ -28,12 +36,12 @@ function rimraf (p, cb) {
rimraf_(p, function CB (er) {
if (er) {
if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) {
- var time = (exports.BUSYTRIES_MAX - busyTries) * 100
busyTries ++
+ var time = busyTries * 100
// try again, with the same exact callback as this one.
return setTimeout(function () {
rimraf_(p, CB)
- })
+ }, time)
}
// this one won't happen if graceful-fs is used.