diff --git a/src/lib/Output.js b/src/lib/Output.js index b69ea1c..724106b 100755 --- a/src/lib/Output.js +++ b/src/lib/Output.js @@ -46,6 +46,7 @@ async function getContent(output, peripherals, config, theme, data) { case 'dir': // eg "templates/" result.push(await getContentFromDirs(output[type][value], output, peripherals, type, config, theme, data)) + break case 'file': // eg "templates/files.njk" @@ -146,17 +147,25 @@ async function getContentFromDirs(dir, output, peripherals, type, config, theme, } + + if (type === 'template') { + // console.log("------", new Template('name', content, theme, data)) result.push(new Template('name', content, theme, data).string) } + + } else { result.push(fs.readFileSync(file, 'utf8')) } } + + } else { + // If main directory has file that matches named output eg "templates/ios.njk" // TODO: Could possibly also check if filename matches model eg. "ios.class.njk" diff --git a/src/lib/Template.js b/src/lib/Template.js index e3a59cf..13ce55c 100755 --- a/src/lib/Template.js +++ b/src/lib/Template.js @@ -92,7 +92,8 @@ class Template { * @return {String} Returns a string which is rendered using a templating engine */ - deepFreeze(theme) + // Deep freezing causing a bug when more than one template used + // deepFreeze(theme) this.name = name this.active = active