Stop walk from descending into next directory
Added ability to stop the walk from descending into a given directory. You use this by calling in either the 'directory' or 'name' event handler. This will prevent the directory from being traversed.
This commit is contained in:
parent
b4b38f7520
commit
7d943ef1f2
|
@ -47,7 +47,11 @@
|
|||
function emitSingleEvents(emitter, path, stats, next, self) {
|
||||
var num = 1 + emitter.listeners(stats.type).length + emitter.listeners("node").length;
|
||||
|
||||
function nextWhenReady() {
|
||||
function nextWhenReady(flag) {
|
||||
if (flag) {
|
||||
stats.flag = flag;
|
||||
flagSet = flag;
|
||||
}
|
||||
num -= 1;
|
||||
if (0 === num) { next.call(self); }
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@
|
|||
|
||||
function appendToDirs(stat) {
|
||||
/*jshint validthis:true*/
|
||||
if(stat.flag && stat.flag === NO_DESCEND) { return; }
|
||||
this.push(stat.name);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue