Allow single conf objects too

This commit is contained in:
Dan Mindru 2016-08-19 22:47:53 +02:00
parent 1bdbed78c9
commit e5cd2fd649
2 changed files with 12 additions and 14 deletions

View File

@ -1,15 +1,11 @@
{
"persons": [
{
"id": "dark",
"signature": "Best regards,",
"name": "The dark mail team",
"contactMain": "Call <a href='tel:004580100100'><span>(45) 80100100</span></a> or email us at",
"contactMail": "info@dark.dk",
"slogan": "LED Pylon. LED Wall. Digital Signage.",
"logoUrl": "/assets/dark.png",
"logoAlt": "dark logo",
"website": "http://dark.dk"
}
]
"id": "dark",
"signature": "Best regards,",
"name": "The dark mail team",
"contactMain": "Call <a href='tel:004580100100'><span>(45) 80100100</span></a> or email us at",
"contactMail": "info@dark.dk",
"slogan": "LED Pylon. LED Wall. Digital Signage.",
"logoUrl": "/assets/dark.png",
"logoAlt": "dark logo",
"website": "http://dark.dk"
}

View File

@ -88,9 +88,11 @@ function buildTask(options){
.forEach(function readConfigurations(dir){
/** NB: For 'watch' to properly work, the cache needs to be deleted before each require. */
var confPath = '../tmp/' + dir + '/conf.json';
var current = null;
delete require.cache[require.resolve(confPath)];
promises.push(makeTemplates(dir, require(confPath).persons));
current = require(confPath);
promises.push(makeTemplates(dir, current.persons || [current]));
});
Q.all(promises);