Improved CLI error messages
This commit is contained in:
parent
05b5a3902e
commit
cd1d14ee8b
9
cli.mjs
9
cli.mjs
@ -31,7 +31,14 @@ const args = process.argv
|
||||
const fileName = args[0];
|
||||
const scriptArgs = args.slice(1);
|
||||
|
||||
const rendered = await renderFile(fileName);
|
||||
let rendered;
|
||||
try {
|
||||
rendered = await renderFile(fileName);
|
||||
} catch (e) {
|
||||
console.log("Error Rendering Template:")
|
||||
console.log(e?.message || "Unknown Error");
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
if (compileOnly) {
|
||||
process.stdout.write(rendered);
|
||||
|
Loading…
Reference in New Issue
Block a user