update filtering to filter everything coming into the hygiene task

This commit is contained in:
Anthony Dresser
2019-11-28 19:57:41 +00:00
parent 0180dd5e4b
commit 1fccc8dc1c

View File

@@ -327,7 +327,12 @@ function hygiene(some) {
let input;
if (Array.isArray(some) || typeof some === 'string' || !some) {
input = vfs.src(some || all, { base: '.', follow: true, allowEmpty: true });
const options = { base: '.', follow: true, allowEmpty: true };
if (some) {
input = vfs.src(some, options).pipe(filter(all)) // split this up to not unnecessarily filter all a second time
} else {
input = vfs.src(all, options);
}
} else {
input = some;
}
@@ -457,7 +462,7 @@ if (require.main === module) {
console.log('Reading git index versions...');
createGitIndexVinyls(some)
.then(vinyls => new Promise((c, e) => hygiene(es.readArray(vinyls).pipe(filter(all)))
.then(vinyls => new Promise((c, e) => hygiene(es.readArray(vinyls))
.on('end', () => c())
.on('error', e)))
.catch(err => {