Skip to content
Browse files

Merge branch 'master' of github.com:wycats/handlebars.js

  • Loading branch information...
2 parents 533be69 + 10669e0 commit 6bf9c6fc134c87dc150e485ea018c4b3f108e6b0 @kpdecker kpdecker committed May 22, 2013
Showing with 7 additions and 3 deletions.
  1. +7 −3 bin/handlebars
View
10 bin/handlebars
@@ -168,10 +168,14 @@ function processTemplate(template, root) {
if (argv.simple) {
output.push(handlebars.precompile(data, options) + '\n');
} else if (argv.partial) {
- if(argv.amd && argv._.length == 1){ output.push('return '); }
+ if(argv.amd && (argv._.length == 1 && !fs.statSync(argv._[0]).isDirectory())) {
+ output.push('return ');
+ }
output.push('Handlebars.partials[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
} else {
- if(argv.amd && argv._.length == 1){ output.push('return '); }
+ if(argv.amd && (argv._.length == 1 && !fs.statSync(argv._[0]).isDirectory())) {
+ output.push('return ');
+ }
output.push('templates[\'' + template + '\'] = template(' + handlebars.precompile(data, options) + ');\n');
}
}
@@ -184,7 +188,7 @@ argv._.forEach(function(template) {
// Output the content
if (!argv.simple) {
if (argv.amd) {
- if(argv._.length > 1){
+ if(argv._.length > 1 || (argv._.length == 1 && fs.statSync(argv._[0]).isDirectory())) {
if(argv.partial){
output.push('return Handlebars.partials;\n');
} else {

0 comments on commit 6bf9c6f

Please sign in to comment.
Something went wrong with that request. Please try again.