Update plugins/scaffolder-backend/src/scaffolder/actions/builtin/fetch/templateFileActionHandler.ts

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Justin Bryant <justintbry@gmail.com>
This commit is contained in:
Justin Bryant
2026-04-17 17:17:12 -04:00
parent b7da1160fb
commit f063176143
@@ -91,11 +91,14 @@ export async function createTemplateFileActionHandler<
},
});
const contents = await fs.readFile(filePath, 'utf-8');
const result = renderTemplate(contents, context);
await fs.ensureDir(path.dirname(outputPath));
await fs.outputFile(outputPath, result);
try {
const contents = await fs.readFile(filePath, 'utf-8');
const result = renderTemplate(contents, context);
await fs.ensureDir(path.dirname(outputPath));
await fs.outputFile(outputPath, result);
dispose();
ctx.logger.info(`Template file has been written to ${outputPath}`);
ctx.logger.info(`Template file has been written to ${outputPath}`);
} finally {
dispose();
}
}