From 1c22b67365769494b251920f743d02126bae0706 Mon Sep 17 00:00:00 2001 From: isaacs Date: Wed, 11 Dec 2013 09:27:13 -0800 Subject: rimraf@2.2.5 --- node_modules/rimraf/README.md | 16 ++++++++++------ node_modules/rimraf/package.json | 19 +++++-------------- node_modules/rimraf/rimraf.js | 14 ++++---------- 3 files changed, 19 insertions(+), 30 deletions(-) (limited to 'node_modules/rimraf') diff --git a/node_modules/rimraf/README.md b/node_modules/rimraf/README.md index 8fc677956..cd123b652 100644 --- a/node_modules/rimraf/README.md +++ b/node_modules/rimraf/README.md @@ -1,4 +1,4 @@ -A `rm -rf` for node. +`rm -rf` for node. Install with `npm install rimraf`, or just drop rimraf.js somewhere. @@ -9,11 +9,10 @@ Install with `npm install rimraf`, or just drop rimraf.js somewhere. The callback will be called with an error if there is one. Certain errors are handled for you: -* `EBUSY` - rimraf will back off a maximum of opts.maxBusyTries times - before giving up. -* `EMFILE` - If too many file descriptors get opened, rimraf will - patiently wait until more become available. - +* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of + `opts.maxBusyTries` times before giving up. +* `ENOENT` - If the file doesn't exist, rimraf will return + successfully, since your desired outcome is already the case. ## rimraf.sync @@ -24,3 +23,8 @@ the async API. It's better. If installed with `npm install rimraf -g` it can be used as a global command `rimraf ` which is useful for cross platform support. + +## mkdirp + +If you need to create a directory recursively, check out +[mkdirp](https://github.com/substack/node-mkdirp). diff --git a/node_modules/rimraf/package.json b/node_modules/rimraf/package.json index ba73163ba..fedc9c3c2 100644 --- a/node_modules/rimraf/package.json +++ b/node_modules/rimraf/package.json @@ -1,6 +1,6 @@ { "name": "rimraf", - "version": "2.2.2", + "version": "2.2.5", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": { @@ -12,9 +12,6 @@ "type": "MIT", "url": "https://github.com/isaacs/rimraf/raw/master/LICENSE" }, - "optionalDependencies": { - "graceful-fs": "~2" - }, "repository": { "type": "git", "url": "git://github.com/isaacs/rimraf.git" @@ -48,18 +45,12 @@ "email": "yosefd@microsoft.com" } ], - "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\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n", + "readme": "`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* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n `opts.maxBusyTries` times before giving up.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\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\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf ` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n", "readmeFilename": "README.md", "bugs": { "url": "https://github.com/isaacs/rimraf/issues" }, - "dependencies": { - "graceful-fs": "~2" - }, - "_id": "rimraf@2.2.2", - "dist": { - "shasum": "d99ec41dc646e55bf7a7a44a255c28bef33a8abf" - }, - "_from": "rimraf@2.2.2", - "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.2.tgz" + "homepage": "https://github.com/isaacs/rimraf", + "_id": "rimraf@2.2.5", + "_from": "rimraf@latest" } diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js index 55f8d9a48..a9258072e 100644 --- a/node_modules/rimraf/rimraf.js +++ b/node_modules/rimraf/rimraf.js @@ -2,14 +2,7 @@ module.exports = rimraf rimraf.sync = rimrafSync var path = require("path") - , fs - -try { - // optional dependency - fs = require("graceful-fs") -} catch (er) { - fs = require("fs") -} +var fs = require("fs") // for EMFILE handling var timeout = 0 @@ -24,7 +17,8 @@ function rimraf (p, cb) { var busyTries = 0 rimraf_(p, function CB (er) { if (er) { - if (er.code === "EBUSY" && busyTries < exports.BUSYTRIES_MAX) { + if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && + busyTries < exports.BUSYTRIES_MAX) { busyTries ++ var time = busyTries * 100 // try again, with the same exact callback as this one. @@ -64,7 +58,7 @@ function rimraf_ (p, cb) { fs.unlink(p, function (er) { if (er) { if (er.code === "ENOENT") - return cb() + return cb(null) if (er.code === "EPERM") return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) if (er.code === "EISDIR") -- cgit v1.2.3