scaffolder: fix templating all files in sub directories for nunjucks action
Co-authored-by: Mike Lewis <mtlewis@users.noreply.github.com> Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
This commit is contained in:
@@ -98,8 +98,8 @@ export function createFetchTemplateAction(options: {
|
||||
|
||||
// Grab some files
|
||||
//
|
||||
// TODO(mtlewis/orkohunter) handle subdirectories
|
||||
const allFilesInTemplates = await globby(`*`, { cwd: templateDir });
|
||||
// TODO(mtlewis/orkohunter) test whether empty directories are templated
|
||||
const allFilesInTemplates = await globby(`**/*`, { cwd: templateDir });
|
||||
|
||||
// Nice for Cookiecutter compat
|
||||
//
|
||||
@@ -123,7 +123,7 @@ export function createFetchTemplateAction(options: {
|
||||
const filepath = templater.renderString(location, ctx.input.values);
|
||||
|
||||
// write file
|
||||
await fs.writeFile(
|
||||
await fs.outputFile(
|
||||
resolvePath(outputPath, filepath),
|
||||
templater.renderString(
|
||||
await fs.readFile(resolvePath(templateDir, location), 'utf-8'),
|
||||
|
||||
Reference in New Issue
Block a user