Skip to content

Commit db24ca2

Browse files
committed
refactor(cli): replace process.exit calls with graceful exit methods
1 parent 7ccdd0f commit db24ca2

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/cli/cli.controller.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ export class CliController {
361361
console.log(
362362
`You can list the available profiles with ${colors.bold(colors.green('--profiles'))} command ${colors.gray('(without arguments)')}.`,
363363
);
364-
process.exit(1);
364+
this.exitWithError();
365365
}
366366

367367
const targets =
@@ -614,7 +614,7 @@ export class CliController {
614614
error: (error) => this.jsonOutputService.writeError(error),
615615
complete: () => {
616616
this.jsonOutputService.completeScan();
617-
process.exit(0);
617+
this.exitGracefully();
618618
},
619619
});
620620
}
@@ -643,7 +643,7 @@ export class CliController {
643643
private setupJsonModeSignalHandlers(): void {
644644
const gracefulShutdown = () => {
645645
this.jsonOutputService.handleShutdown();
646-
process.exit(0);
646+
this.exitGracefully();
647647
};
648648

649649
process.on('SIGINT', gracefulShutdown);

0 commit comments

Comments
 (0)