Merge pull request #271 from es128/patch-1
Simplify chokidar event handler
This commit is contained in:
commit
ccb56fe33f
@ -116,13 +116,11 @@ module.exports = function (commander, filenames) {
|
||||
var watcher = chokidar.watch(filenames, {
|
||||
persistent: true,
|
||||
ignoreInitial: true
|
||||
});
|
||||
|
||||
_.each(["add", "change", "unlink"], function (type) {
|
||||
watcher.on(type, function (filename) {
|
||||
}).on("all", function (type, filename) {
|
||||
if (type === "add" || type === "change" || type === "unlink" ) {
|
||||
console.log(type, filename);
|
||||
walk();
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user