Add path filters to options
This commit is contained in:
parent
42cdccff35
commit
09ba753b80
12
lib/walk.js
12
lib/walk.js
|
@ -35,6 +35,7 @@
|
||||||
me._wq = [];
|
me._wq = [];
|
||||||
me._wqueue = [me._wq];
|
me._wqueue = [me._wq];
|
||||||
me._wcurpath = undefined;
|
me._wcurpath = undefined;
|
||||||
|
me._wasyncFilters = options.asyncFilters;
|
||||||
me._wfirstrun = true;
|
me._wfirstrun = true;
|
||||||
me._wcurpath = pathname;
|
me._wcurpath = pathname;
|
||||||
|
|
||||||
|
@ -187,6 +188,17 @@
|
||||||
var me = this
|
var me = this
|
||||||
;
|
;
|
||||||
|
|
||||||
|
// Stop directories that contain filter keywords
|
||||||
|
// from continuing through the walk process
|
||||||
|
if (me._wasyncFilters != undefined) {
|
||||||
|
var shouldExclude = false;
|
||||||
|
for (var iFilter=0; iFilter<me._wasyncFilters.length; ++iFilter) {
|
||||||
|
if (me._wcurpath.indexOf(me._wasyncFilters[iFilter]) != -1 ) {
|
||||||
|
me._wNext();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// TODO how to remove this anony?
|
// TODO how to remove this anony?
|
||||||
fs.readdir(me._wcurpath, function (err, files) {
|
fs.readdir(me._wcurpath, function (err, files) {
|
||||||
me._wReaddirHandler(err, files);
|
me._wReaddirHandler(err, files);
|
||||||
|
|
Loading…
Reference in New Issue