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>2013-01-24 20:55:24 +0400
committerisaacs <i@izs.me>2013-01-24 20:55:24 +0400
commitffa68ca39ea99f77cfba826a42f2e873ca5835bd (patch)
tree1e8d1f946fd2a9108bd1a4e42001d055c7426657 /node_modules/rimraf
parent4b5975d76733c89ccfa52f77ffc32a86d6aff7f6 (diff)
rimraf@2.1.2
Diffstat (limited to 'node_modules/rimraf')
-rw-r--r--node_modules/rimraf/package.json9
-rw-r--r--node_modules/rimraf/rimraf.js10
2 files changed, 13 insertions, 6 deletions
diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json
index ce7e1ddcf..3063a89d5 100644
--- a/node_modules/rimraf/package.json
+++ b/node_modules/rimraf/package.json
@@ -1,6 +1,6 @@
{
"name": "rimraf",
- "version": "2.1.1",
+ "version": "2.1.2",
"main": "rimraf.js",
"description": "A deep deletion module for node (like `rm -rf`)",
"author": {
@@ -47,12 +47,9 @@
],
"readme": "A `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\n\nThe callback will be called with an error if there is one. Certain\nerrors are handled for you:\n\n* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times\n before giving up.\n* `EMFILE` - If too many file descriptors get opened, rimraf will\n patiently wait until more become available.\n\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too. But that's not so good. Use\nthe async API. It's better.\n",
"readmeFilename": "README.md",
- "_id": "rimraf@2.1.1",
+ "_id": "rimraf@2.1.2",
"dependencies": {
"graceful-fs": "~1.1"
},
- "dist": {
- "shasum": "ee9cec7e2d796ef59ceaa5f3a3024c225e630c61"
- },
- "_from": "rimraf@2.1.1"
+ "_from": "rimraf@2"
}
diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js
index 7fc291c67..6a67fb430 100644
--- a/node_modules/rimraf/rimraf.js
+++ b/node_modules/rimraf/rimraf.js
@@ -69,6 +69,16 @@ function rimraf_ (p, cb) {
}
function rmdir (p, cb) {
+ // try to rmdir first, and only readdir on ENOTEMPTY
+ fs.rmdir(p, function (er) {
+ if (er && er.code === "ENOTEMPTY")
+ rmkids(p, cb)
+ else
+ cb(er)
+ })
+}
+
+function rmkids(p, cb) {
fs.readdir(p, function (er, files) {
if (er)
return cb(er)