Permalink
Browse files

Remove gently option

  • Loading branch information...
1 parent 6e66f2a commit 9035368330918a3dd202511636241547604bb221 @isaacs committed Jan 30, 2012
Showing with 0 additions and 20 deletions.
  1. +0 −4 README.md
  2. +0 −16 rimraf.js
View
4 README.md
@@ -20,10 +20,6 @@ The options object is optional. These fields are respected:
* `maxBusyTries` - The number of times to retry a file or folder in the
event of an `EBUSY` error. The default is 3.
-* `gently` - If provided a `gently` path, then rimraf will only delete
- files and folders that are beneath this path, and only delete symbolic
- links that point to a place within this path. (This is very important
- to npm's use-case, and shows rimraf's pedigree.)
## rimraf.sync
View
16 rimraf.js
@@ -27,8 +27,6 @@ function rimraf (p, opts, cb) {
var busyTries = 0
opts.maxBusyTries = opts.maxBusyTries || 3
- if (opts.gently) opts.gently = path.resolve(opts.gently)
-
rimraf_(p, opts, function CB (er) {
if (er) {
if (er.code === "EBUSY" && busyTries < opts.maxBusyTries) {
@@ -65,8 +63,6 @@ function rimraf_ (p, opts, cb) {
return cb(er)
}
- // don't delete that don't point actually live in the "gently" path
- if (opts.gently) return clobberTest(p, s, opts, cb)
return rm_(p, s, opts, cb)
})
}
@@ -122,18 +118,6 @@ function rm_ (p, s, opts, cb) {
})
}
-function clobberTest (p, s, opts, cb) {
- var gently = opts.gently
- if (!s.isSymbolicLink()) next(null, path.resolve(p))
- else realish(p, next)
-
- function next (er, rp) {
- if (er) return rm_(p, s, opts, cb)
- if (rp.indexOf(gently) !== 0) return clobberFail(p, gently, cb)
- else return rm_(p, s, opts, cb)
- }
-}
-
function realish (p, cb) {
fs.readlink(p, function (er, r) {
if (er) return cb(er)

0 comments on commit 9035368

Please sign in to comment.