gently-rm.js 484 B

123456789101112131415161718192021
  1. // only remove the thing if it's a symlink into a specific folder. This is
  2. // a very common use-case of npm's, but not so common elsewhere.
  3. exports = module.exports = gentlyRm
  4. var gentleFS = require('gentle-fs')
  5. var gentleFSOpts = require('../config/gentle-fs.js')
  6. function gentlyRm (target, gently, base, cb) {
  7. if (!cb) {
  8. cb = base
  9. base = undefined
  10. }
  11. if (!cb) {
  12. cb = gently
  13. gently = false
  14. }
  15. return gentleFS.rm(target, gentleFSOpts(gently, base), cb)
  16. }