Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions handlebars-precompiler.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ exports.do = function(opts) {
fs.readdirSync(template).map(function(file) {
var path = template + '/' + file;

if (fileRegex.test(path) || fs.statSync(path).isDirectory()) {
if (path[path.length-1] !== '~' && (fileRegex.test(path) || fs.statSync(path).isDirectory())) {
processTemplate(path, root || template);
}
});
Expand Down Expand Up @@ -121,8 +121,6 @@ exports.watchDir = function(dir, outfile, extensions) {
}

var compileOnChange = function(event, filename) {
console.log('[' + event + '] detected in ' + (filename ? filename : '[filename not supported]'));
console.log('[compiling] ' + outfile);
exports.do({
templates: [dir],
output: outfile,
Expand All @@ -136,8 +134,7 @@ exports.watchDir = function(dir, outfile, extensions) {
for(var i = 0; i < files.length; i++) {
var file = files[i];
if(regex.test(file)) {
fs.watch(file, compileOnChange);
console.log('[watching] ' + file);
fs.watchFile(file, { interval: 207, persistent: true }, compileOnChange);
}
}
}
Expand Down