diff options
author | Rebecca Turner <me@re-becca.org> | 2016-01-07 02:55:36 +0300 |
---|---|---|
committer | Rebecca Turner <me@re-becca.org> | 2016-01-07 04:21:08 +0300 |
commit | 5e510e13d022a22d58742b126482d3b38a14cc83 (patch) | |
tree | 1f4408a27bf4f96e1e68389eeb291cae33bbb420 /node_modules/rimraf/rimraf.js | |
parent | 755821569466b7be0883f4b0573eeb83c24109eb (diff) |
rimraf@2.5.0
Adds ability to disable glob support / pass in options.
Credit: @isaacs
Diffstat (limited to 'node_modules/rimraf/rimraf.js')
-rw-r--r-- | node_modules/rimraf/rimraf.js | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/node_modules/rimraf/rimraf.js b/node_modules/rimraf/rimraf.js index 7771b530c..c01d13b20 100644 --- a/node_modules/rimraf/rimraf.js +++ b/node_modules/rimraf/rimraf.js @@ -6,10 +6,8 @@ var path = require("path") var fs = require("fs") var glob = require("glob") -var globOpts = { +var defaultGlobOpts = { nosort: true, - nocomment: true, - nonegate: true, silent: true } @@ -35,7 +33,11 @@ function defaults (options) { options.maxBusyTries = options.maxBusyTries || 3 options.emfileWait = options.emfileWait || 1000 + if (options.glob === false) { + options.disableGlob = true + } options.disableGlob = options.disableGlob || false + options.glob = options.glob || defaultGlobOpts } function rimraf (p, options, cb) { @@ -63,7 +65,7 @@ function rimraf (p, options, cb) { if (!er) return afterGlob(null, [p]) - glob(p, globOpts, afterGlob) + glob(p, options.glob, afterGlob) }) function next (er) { @@ -270,7 +272,7 @@ function rimrafSync (p, options) { fs.lstatSync(p) results = [p] } catch (er) { - results = glob.sync(p, globOpts) + results = glob.sync(p, options.glob) } } |