previously ejs.compile() was corrupting binary files, like images, which wouldn't copy properly to project folder. Added hacky gaurd clause to only ejs.compile() on files with content that matches the template <%=.*=>
const templateBuffer = fs.readFileSync(absolutePath)
const templateString = templateBuffer.toString()
// if templatable, compile with ejs
let output = (/<%=.*%>/.test(templateString)) ?
ejs.compile(templateString)(options) :
templateBuffer;
const tmpDestination = path.join(temporaryDirectory, pathFromDirectoryRoot);
ensureDirectoryExistence(tmpDestination);
fs.writeFileSync(tmpDestination, output);
Also disabled templating unit tests because unsure of how to handle new flow with user input (inquirer)
previously
ejs.compile()
was corrupting binary files, like images, which wouldn't copy properly to project folder. Added hacky gaurd clause to onlyejs.compile()
on files with content that matches the template<%=.*=>
Also disabled templating unit tests because unsure of how to handle new flow with user input (inquirer)