Skip to content

Commit

Permalink
proper ignore files/dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Balestra committed Sep 9, 2017
1 parent 8c998f5 commit 28ff566
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/cli/domain/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,17 @@ module.exports = function(dirs, baseDir, changed) {
{
interval: 0.5,
ignoreUnreadableDir: true,
ignoreDotFiles: false
ignoreDotFiles: false,
filter: fileOrDir =>
/node_modules|package\.tar\.gz|_package|\.sw[op]|\.git|\.DS_Store|oc\.json/.test(
fileOrDir
) === false
},
(fileName, currentStat, previousStat) => {
console.log(fileName);
if (!!currentStat || !!previousStat) {
if (
/node_modules|package\.tar\.gz|_package|\.sw[op]|\.git|\.DS_Store/gi.test(
fileName
) === false
) {
const componentDir = dirs.find(dir => Boolean(fileName.match(dir)));
changed(null, fileName, componentDir);
}
const componentDir = dirs.find(dir => Boolean(fileName.match(dir)));
changed(null, fileName, componentDir);
}
}
);
Expand Down

0 comments on commit 28ff566

Please sign in to comment.