Skip to content

Commit

Permalink
Merge branch 'fix/exit-code-1-on-error' into release/cmd-1.1.1-beta
Browse files Browse the repository at this point in the history
  • Loading branch information
vCaisim committed Oct 2, 2024
2 parents 6289b82 + 8f12eaf commit 7a3a386
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions packages/cmd/src/logger/logger.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,19 +31,16 @@ export const warnWithNoTrace = (...args: unknown[]) => {
return log(chalk.bgYellow.black(' WARNING '), msg);
};

export const errorWithNoTrace = (...args: unknown[]) => {
const msg = util.format(...args);
debug('ERRRO: ', msg);
return log(chalk.bgRed.white(' ERROR '), msg);
};

export const success = (...args: unknown[]) =>
log(chalk.green.bold(util.format(...args)));

export const error = (...args: unknown[]) => {
const msg = util.format(...args);
const formattedArgs = args.map((arg) =>
arg instanceof Error ? arg.message : arg
);
const msg = util.format(...formattedArgs);
errors.push(msg);
debug('ERROR: ', msg);
debug('ERROR: ', util.format(...args));
return _error(chalk.bgRed.white(' ERROR '), msg);
};

Expand Down

0 comments on commit 7a3a386

Please sign in to comment.