Skip to content

Commit

Permalink
added error todo
Browse files Browse the repository at this point in the history
  • Loading branch information
thlorenz committed Aug 23, 2012
1 parent 3acb2b8 commit c216129
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions watcher.js
Expand Up @@ -39,8 +39,8 @@ Watcher.prototype.watchTemplatesAndPartials = function () {

function keepWarm(file, process) {
watch(file, 'change', function (file) {
fs.readFile(file.fullPath,function (err, content) {
if (err) cb(err);
fs.readFile(file.fullPath, function (err, content) {
if (err) process(err);
else process(file, content.toString());
});
});
Expand All @@ -49,6 +49,7 @@ Watcher.prototype.watchTemplatesAndPartials = function () {
function watchTemplates(watchingAll) {
self.templateFiles.forEach(function (file) {
keepWarm(file, function (err, plate) {
// TODO: if error emit it
self.emit('templateChanged', file, plate);
self.emit('fileChanged', file, plate);
});
Expand Down

0 comments on commit c216129

Please sign in to comment.