diff --git a/lib/utils/index.js b/lib/utils/index.js index 4bd36f657..942f82182 100644 --- a/lib/utils/index.js +++ b/lib/utils/index.js @@ -326,12 +326,12 @@ module.exports = { 'Module level templates extend project level templates if there are duplicates. You will need to change: ' + template); } - if (!templates[template]) { + // Replace + if (template in templates) { + t.update(templates[template]); + } else { SCli.log('WARNING: the following template is requested but not defined: ' + template + (data.name ? ' in ' + data.name : '')); } - - // Replace - if (templates[template]) t.update(templates[template]); } }); @@ -351,7 +351,7 @@ module.exports = { let variableName = variableSyntax.replace(varTemplateSyntax, (match, varName) => varName.trim()); let value; - if (variablesObject[variableName]) { + if (variableName in variablesObject) { value = variablesObject[variableName]; } @@ -449,4 +449,4 @@ module.exports = { return functions; } -}; \ No newline at end of file +};