summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/rimraf
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2012-01-16 15:06:16 -0800
committerisaacs <i@izs.me>2012-01-16 15:06:16 -0800
commit25410096b4c38eb9b17501ea06349872ab33e1ea (patch)
treeeaebef0d121d13a517114bdb1e0b5c08a1500088 /deps/npm/node_modules/rimraf
parentf0c1376e07e6d5a4deb3d088bd3153d7f6af1298 (diff)
downloadandroid-node-v8-25410096b4c38eb9b17501ea06349872ab33e1ea.tar.gz
android-node-v8-25410096b4c38eb9b17501ea06349872ab33e1ea.tar.bz2
android-node-v8-25410096b4c38eb9b17501ea06349872ab33e1ea.zip
Update npm to 1.1.0-2
Diffstat (limited to 'deps/npm/node_modules/rimraf')
-rw-r--r--deps/npm/node_modules/rimraf/package.json2
-rw-r--r--deps/npm/node_modules/rimraf/rimraf.js15
2 files changed, 11 insertions, 6 deletions
diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json
index 5b48d5bb2e..2b69536ef9 100644
--- a/deps/npm/node_modules/rimraf/package.json
+++ b/deps/npm/node_modules/rimraf/package.json
@@ -1,5 +1,5 @@
{"name":"rimraf"
-,"version":"1.0.8"
+,"version":"1.0.9"
,"main":"rimraf.js"
,"description":"A deep deletion module for node (like `rm -rf`)"
,"author":"Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)"
diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js
index 27e22669e3..e8104e9e4b 100644
--- a/deps/npm/node_modules/rimraf/rimraf.js
+++ b/deps/npm/node_modules/rimraf/rimraf.js
@@ -31,7 +31,7 @@ function rimraf (p, opts, cb) {
rimraf_(p, opts, function CB (er) {
if (er) {
- if (er.message.match(/^EBUSY/) && busyTries < opts.maxBusyTries) {
+ if (er.code === "EBUSY" && busyTries < opts.maxBusyTries) {
var time = (opts.maxBusyTries - busyTries) * 100
busyTries ++
// try again, with the same exact callback as this one.
@@ -41,14 +41,14 @@ function rimraf (p, opts, cb) {
}
// this one won't happen if graceful-fs is used.
- if (er.message.match(/^EMFILE/) && timeout < EMFILE_MAX) {
+ if (er.code === "EMFILE" && timeout < EMFILE_MAX) {
return setTimeout(function () {
rimraf_(p, opts, CB)
}, timeout ++)
}
// already gone
- if (er.message.match(/^ENOENT/)) er = null
+ if (er.code === "ENOENT") er = null
}
timeout = 0
@@ -61,7 +61,7 @@ function rimraf_ (p, opts, cb) {
// if the stat fails, then assume it's already gone.
if (er) {
// already gone
- if (er.message.match(/^ENOENT/)) return cb()
+ if (er.code === "ENOENT") return cb()
// some other kind of error, permissions, etc.
return cb(er)
}
@@ -131,7 +131,12 @@ function asyncForEach (list, fn, cb) {
// this looks simpler, but it will fail with big directory trees,
// or on slow stupid awful cygwin filesystems
function rimrafSync (p) {
- var s = fs[lstatSync](p)
+ try {
+ var s = fs[lstatSync](p)
+ } catch (er) {
+ if (er.code === "ENOENT") return
+ throw er
+ }
if (!s.isDirectory()) return fs.unlinkSync(p)
fs.readdirSync(p).forEach(function (f) {
rimrafSync(path.join(p, f))