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:
+9
-6
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user