Skip to content

Commit

Permalink
fix: stop CLI when a plugin fails
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlacenka committed Feb 29, 2024
1 parent 0724ab6 commit 263537c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion packages/plugin-coverage/src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { executeRunner } from './lib/runner';

await executeRunner().catch(console.error);
await executeRunner();
7 changes: 3 additions & 4 deletions packages/plugin-coverage/src/lib/runner/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ export async function executeRunner(): Promise<void> {
// Run coverage tool if provided
if (coverageToolCommand != null) {
const { command, args } = coverageToolCommand;

try {
await executeProcess({ command, args });
} catch (error) {
if (error instanceof ProcessError) {
console.info(chalk.bold('stdout from failed process:'));
console.info(error.stdout);
console.error(chalk.bold('stderr from failed process:'));
console.error(chalk.bold('stdout from failed coverage tool process:'));
console.error(error.stdout);
console.error(chalk.bold('stderr from failed coverage tool process:'));
console.error(error.stderr);
}

Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-eslint/src/bin.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { executeRunner } from './lib/runner';

await executeRunner().catch(console.error);
await executeRunner();

0 comments on commit 263537c

Please sign in to comment.