fix(security): avoid raw CLI result logging
Some checks failed
Check / Cookbook and examples (push) Has been cancelled

This commit is contained in:
Vincent Koc 2026-04-30 03:08:18 -07:00
parent ed63cf9d48
commit 700e92ca1d
No known key found for this signature in database

View File

@ -39,9 +39,11 @@ async function main(argv: string[]): Promise<unknown> {
try {
const result = await main(process.argv.slice(2));
console.log(
typeof result === "string" ? result : JSON.stringify(redactSensitiveOutput(result), null, 2),
);
if (typeof result === "string") {
process.stdout.write(`${result}\n`);
} else {
console.log(JSON.stringify(redactSensitiveOutput(result), null, 2));
}
} catch (error) {
console.error(error instanceof Error ? error.message : String(error));
process.exitCode = 1;