Skip to content

Commit

Permalink
Remove gently option
Browse files Browse the repository at this point in the history
  • Loading branch information
isaacs committed Jan 30, 2012
1 parent 6e66f2a commit 9035368
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 20 deletions.
4 changes: 0 additions & 4 deletions README.md
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions rimraf.js
Expand Up @@ -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) {
Expand Down Expand Up @@ -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)
})
}
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9035368

Please sign in to comment.