Skip to content

Commit

Permalink
Nicer output when script succeeds
Browse files Browse the repository at this point in the history
  • Loading branch information
marclefrancois committed Mar 1, 2024
1 parent a36ddec commit fde2c0b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions cli/src/services/formatters/hook-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,9 @@ export default class HookRunnerFomatter {
});
console.log('');
}
success(command: string, message: string) {
console.log(chalk.green('✓ '), chalk.bold(chalk.green(`${command}:`)));
console.log(' ', chalk.green(message));
console.log('');
}
}
2 changes: 1 addition & 1 deletion cli/src/services/hook-runner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ export default class HookRunner {
hooks.forEach((hook) => {
try {
const output: string = execSync(hook, {stdio: 'pipe'}).toString();
formatter.log(hook, [output]);
formatter.success(hook, output);
} catch (error: any) {
formatter.error(hook, [error.stderr.toString()]);
process.exit(error.status);
Expand Down

0 comments on commit fde2c0b

Please sign in to comment.