File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -168,10 +168,14 @@ function processTemplate(template, root) {
168168 if ( argv . simple ) {
169169 output . push ( handlebars . precompile ( data , options ) + '\n' ) ;
170170 } else if ( argv . partial ) {
171- if ( argv . amd && argv . _ . length == 1 ) { output . push ( 'return ' ) ; }
171+ if ( argv . amd && ( argv . _ . length == 1 && ! fs . statSync ( argv . _ [ 0 ] ) . isDirectory ( ) ) ) {
172+ output . push ( 'return ' ) ;
173+ }
172174 output . push ( 'Handlebars.partials[\'' + template + '\'] = template(' + handlebars . precompile ( data , options ) + ');\n' ) ;
173175 } else {
174- if ( argv . amd && argv . _ . length == 1 ) { output . push ( 'return ' ) ; }
176+ if ( argv . amd && ( argv . _ . length == 1 && ! fs . statSync ( argv . _ [ 0 ] ) . isDirectory ( ) ) ) {
177+ output . push ( 'return ' ) ;
178+ }
175179 output . push ( 'templates[\'' + template + '\'] = template(' + handlebars . precompile ( data , options ) + ');\n' ) ;
176180 }
177181 }
@@ -184,7 +188,7 @@ argv._.forEach(function(template) {
184188// Output the content
185189if ( ! argv . simple ) {
186190 if ( argv . amd ) {
187- if ( argv . _ . length > 1 ) {
191+ if ( argv . _ . length > 1 || ( argv . _ . length == 1 && fs . statSync ( argv . _ [ 0 ] ) . isDirectory ( ) ) ) {
188192 if ( argv . partial ) {
189193 output . push ( 'return Handlebars.partials;\n' ) ;
190194 } else {
You can’t perform that action at this time.
0 commit comments