Tiny changes to allow for falsy values to be used in templates and variables.

This commit is contained in:
Erik Erikson 2016-03-14 13:59:02 -07:00
parent 0710f2fc3a
commit 950d0b665f

View File

@ -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;
}
};
};