Skip to content

Commit

Permalink
Fix command line error display
Browse files Browse the repository at this point in the history
  • Loading branch information
phensley committed Jan 9, 2024
1 parent 84d4ad6 commit 735369f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions packages/less-ts-cli/src/lessc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,12 @@ const run = (y: yargs.Arguments): void => {
} else {
const result = compiler.compile(source);
console.log(result.css);
for (const err of result.errors) {
const msg = err.errors.map((e) => e.message).join(', ');
console.error(`Error ${msg}`);

if (result.errors) {
const msgs = compiler.formatErrors(result.errors);
for (const m of msgs) {
console.error(m);
}
}
}
} catch (e) {
Expand Down

0 comments on commit 735369f

Please sign in to comment.