Add path filters to options

This commit is contained in:
ZECTBynmo 2013-04-18 23:03:35 -04:00
parent 42cdccff35
commit 09ba753b80
1 changed files with 12 additions and 0 deletions

View File

@ -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);