Skip to content
This repository has been archived by the owner on May 25, 2022. It is now read-only.

Remove calls to process.exit() which forces async calls to exit early #15

Merged
merged 5 commits into from
Jun 20, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion jslib
7 changes: 4 additions & 3 deletions src/program.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export class Program {
program.on('command:*', () => {
writeLn(chalk.redBright('Invalid command: ' + program.args.join(' ')));
writeLn('See --help for a list of available commands.', true);
process.exit(1);
process.exitCode = 1;
});

program.on('--help', () => {
Expand Down Expand Up @@ -502,7 +502,7 @@ export class Program {
writeLn(chalk.redBright(response.message), true);
}
}
process.exit(1);
process.exitCode = 1;
return;
}

Expand All @@ -529,7 +529,8 @@ export class Program {
writeLn(out, true);
}
}
process.exit();
process.exitCode = 0;

}

private getJson(obj: any): string {
Expand Down