fixed bug if default templates folder missing (in case you planned on building an entire theme from scratch)

v1.18.x
psychobunny 11 years ago
parent 464c2f42c3
commit 6acdc66470

@ -85,8 +85,12 @@ function compileTemplates(pluginTemplates) {
utils.walk(nconf.get('theme_templates_path'), function (err, themeTpls) {
var paths = pluginTemplates;
baseTpls = baseTpls.map(function(tpl) { return tpl.replace(nconf.get('base_templates_path'), ''); });
themeTpls = themeTpls.map(function(tpl) { return tpl.replace(nconf.get('theme_templates_path'), ''); });
if (!baseTpls || !themeTpls) {
winston.warn('[themes] Could not find base template files at: ' + nconf.get('base_templates_path'));
}
baseTpls = !baseTpls ? [] : baseTpls.map(function(tpl) { return tpl.replace(nconf.get('base_templates_path'), ''); });
themeTpls = !themeTpls ? [] : themeTpls.map(function(tpl) { return tpl.replace(nconf.get('theme_templates_path'), ''); });
baseTpls.forEach(function(el, i) {
var relative_path = (themeTpls.indexOf(el) !== -1 ? themeTpls[themeTpls.indexOf(el)] : baseTpls[i]),

Loading…
Cancel
Save