Allow single conf objects too
This commit is contained in:
parent
1bdbed78c9
commit
e5cd2fd649
|
|
@ -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"
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in New Issue