add try-catch to bin watching compilation - fixes #901
This commit is contained in:
parent
75b5f32e7a
commit
1eb53dd13a
@ -64,7 +64,11 @@ module.exports = function (commander, filenames, opts) {
|
||||
_.each(["add", "change"], function (type) {
|
||||
watcher.on(type, function (filename) {
|
||||
var relative = path.relative(dirname, filename) || filename;
|
||||
if (util.canCompile(filename)) write(filename, relative);
|
||||
try {
|
||||
if (util.canCompile(filename)) write(filename, relative);
|
||||
} catch (err) {
|
||||
console.error(err.stack);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
@ -119,7 +119,11 @@ module.exports = function (commander, filenames) {
|
||||
}).on("all", function (type, filename) {
|
||||
if (type === "add" || type === "change") {
|
||||
console.log(type, filename);
|
||||
walk();
|
||||
try {
|
||||
walk();
|
||||
} catch (err) {
|
||||
console.error(err.stack);
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user