diff --git a/cli/src/services/formatters/hook-runner.ts b/cli/src/services/formatters/hook-runner.ts index 27f24ba4..fabb2d3d 100644 --- a/cli/src/services/formatters/hook-runner.ts +++ b/cli/src/services/formatters/hook-runner.ts @@ -7,7 +7,7 @@ const capitalizeFirstLetter = (str: string) => export default class HookRunnerFomatter { log(name: string, commands: string[]) { - const operation = capitalizeFirstLetter(decamelize(name, {separator: ' '})); + const operation = capitalizeFirstLetter(decamelize(name, { separator: ' ' })); console.log(chalk.yellow('➤ '), chalk.bold(chalk.yellow(`${operation}:`))); commands.forEach((command) => { console.log(' ', chalk.yellow(command)); diff --git a/cli/src/services/hook-runner.ts b/cli/src/services/hook-runner.ts index c8db487e..39835b8d 100644 --- a/cli/src/services/hook-runner.ts +++ b/cli/src/services/hook-runner.ts @@ -1,11 +1,11 @@ // Vendor -import {execSync} from 'child_process'; +import { execSync } from 'child_process'; // Formatters import Formatter from './formatters/hook-runner'; // Types -import {HookConfig, Hooks} from '../types/document-config'; +import { HookConfig, Hooks } from '../types/document-config'; import Document from './document'; export default class HookRunner { @@ -32,7 +32,7 @@ export default class HookRunner { formatter.log(hook, [output]) } catch (error: any) { formatter.error(hook, [error.stderr.toString()]); - throw new Error(`Hook execution failed for '${hook}': ${error.stderr.toString()}`); + process.exit(error.status); } }); }