Comparing version 0.4.13 to 0.4.14
@@ -29,14 +29,20 @@ var fs = require('fs'); | ||
var self = this; | ||
self.watching = fs.watch(self.path, function (ev) { | ||
//文件的rename不监控, 因为所在目录肯定会有rename | ||
if (!self.subs && ev === 'rename') { | ||
return; | ||
} | ||
try { | ||
self.watching = fs.watch(self.path, function (ev) { | ||
//文件的rename不监控, 因为所在目录肯定会有rename | ||
if (!self.subs && ev === 'rename') { | ||
return; | ||
} | ||
self.emit(ev, { | ||
path: self.path | ||
self.emit(ev, { | ||
path: self.path | ||
}); | ||
}); | ||
} catch (e) { | ||
console.log("watch error: ", self.path, self.subs); | ||
console.dir(e); | ||
//do nothing maybe this file is just deleted; | ||
} | ||
}); | ||
if (self.subs && self.subs.length) { | ||
@@ -43,0 +49,0 @@ self.subs.forEach(function (subtree) { |
@@ -5,3 +5,3 @@ { | ||
"description": "build front project", | ||
"version": "0.4.13", | ||
"version": "0.4.14", | ||
"repository": { | ||
@@ -8,0 +8,0 @@ "type": "git", |
1561141
38986