Skip to content

Commit

Permalink
Disabled freezing theme object
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinmcfarland committed Aug 8, 2024
1 parent 90d34d6 commit 00f053b
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions src/lib/Output.js
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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"

Expand Down
3 changes: 2 additions & 1 deletion src/lib/Template.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 00f053b

Please sign in to comment.