From fde2c0b2facfc7d2a5580d4e0ea4e90c149ae412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20Lefran=C3=A7ois?= Date: Fri, 1 Mar 2024 16:57:53 -0500 Subject: [PATCH] Nicer output when script succeeds --- cli/src/services/formatters/hook-runner.ts | 5 +++++ cli/src/services/hook-runner.ts | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/cli/src/services/formatters/hook-runner.ts b/cli/src/services/formatters/hook-runner.ts index 27f24ba4..0f5d72dc 100644 --- a/cli/src/services/formatters/hook-runner.ts +++ b/cli/src/services/formatters/hook-runner.ts @@ -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(''); +} } diff --git a/cli/src/services/hook-runner.ts b/cli/src/services/hook-runner.ts index 9b278f83..2f3381e8 100644 --- a/cli/src/services/hook-runner.ts +++ b/cli/src/services/hook-runner.ts @@ -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);