chore: updating stuff

Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
blam
2021-06-29 16:02:48 +02:00
committed by Himanshu Mishra
parent 156fefcd82
commit 9b3c9c16d5
@@ -90,24 +90,26 @@ export function createFetchTemplateAction(options: {
ctx.input.values,
);
// Grab some files
const allFilesInTemplates = await globby(`*`, { cwd: templateDir });
// Nice for Cookiecutter compat
nunjucks.installJinjaCompat();
// Create a templater
const templater = nunjucks.configure({
tags: {
variableStart: '${',
variableEnd: '}',
variableStart: '${{',
variableEnd: '}}',
},
autoescape: false,
});
// Need to work out how to autoescape but not this
templater.addFilter('jsonify', s => JSON.stringify(s));
for (const location of allFilesInTemplates) {
console.log(location);
const filepath = templater.renderString(location, ctx.input.values);
console.log(filepath);
console.log('is', resolvePath(outputPath, filepath));
await fs.writeFile(
resolvePath(outputPath, filepath),
templater.renderString(