Skip to content

Commit

Permalink
Always process explicitly passed files in CLI
Browse files Browse the repository at this point in the history
Fixes #689
  • Loading branch information
kpdecker committed Jan 18, 2014
1 parent fe4880f commit 051618c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions bin/handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ if (!argv.simple) {
output.push(argv.namespace);
output.push(' || {};\n');
}
function processTemplate(template, root) {
function processTemplate(template, root, explicit) {
var path = template,
stat = fs.statSync(path);
if (stat.isDirectory()) {
Expand All @@ -150,7 +150,7 @@ function processTemplate(template, root) {
processTemplate(path, root || template);
}
});
} else if (extension.test(path)) {
} else if (explicit || extension.test(path)) {
var data = fs.readFileSync(path, 'utf8');

if (argv.bom && data.indexOf('\uFEFF') === 0) {
Expand Down Expand Up @@ -191,7 +191,7 @@ function processTemplate(template, root) {
}

argv._.forEach(function(template) {
processTemplate(template, argv.root);
processTemplate(template, argv.root, true);
});

// Output the content
Expand Down

0 comments on commit 051618c

Please sign in to comment.