hygiene: handle deletions

This commit is contained in:
Joao Moreno 2018-02-27 11:13:47 +01:00
parent 71c0182177
commit 672449281b

View file

@ -351,7 +351,9 @@ function createGitIndexVinyls(paths) {
const fullPath = path.join(repositoryPath, relativePath);
fs.stat(fullPath, (err, stat) => {
if (err) {
if (err && err.code === 'ENOENT') { // ignore deletions
return c(null);
} else if (err) {
return e(err);
}
@ -370,7 +372,8 @@ function createGitIndexVinyls(paths) {
});
}));
return pall(fns, { concurrency: 4 });
return pall(fns, { concurrency: 4 })
.then(r => r.filter(p => !!p));
}
gulp.task('hygiene', () => hygiene());