From 84d4ad65431e06a70e949e48807fa651e34c4a5a Mon Sep 17 00:00:00 2001 From: Patrick Hensley Date: Tue, 9 Jan 2024 14:06:54 -0500 Subject: [PATCH] Fix command line error display --- packages/less-ts-cli/src/lessc.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/less-ts-cli/src/lessc.ts b/packages/less-ts-cli/src/lessc.ts index 22e6961..87166aa 100644 --- a/packages/less-ts-cli/src/lessc.ts +++ b/packages/less-ts-cli/src/lessc.ts @@ -38,7 +38,8 @@ const run = (y: yargs.Arguments): void => { const result = compiler.compile(source); console.log(result.css); for (const err of result.errors) { - console.log(`Error ${err}`); + const msg = err.errors.map((e) => e.message).join(', '); + console.error(`Error ${msg}`); } } } catch (e) { @@ -58,7 +59,7 @@ export const main = () => { describe: 'path to source stylesheet', type: 'string', }), - run + run, ) .option('p', { alias: 'parse',