Skip to content

Commit

Permalink
Hotfix/fix early exit (#116)
Browse files Browse the repository at this point in the history
  • Loading branch information
rohit-gohri committed Aug 10, 2023
1 parent f229dd4 commit cb2e67d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
5 changes: 5 additions & 0 deletions .changeset/clever-dryers-cough.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@honestfoodcompany/pubsub': patch
---

Fix exit on success
19 changes: 7 additions & 12 deletions src/cli/subscriptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,16 +43,11 @@ async function main() {
}

if (require.main === module) {
main()
.then(() => {
Logger.Instance.info('Finished');
process.exit(0);
})
.catch(async (err) => {
Logger.Instance.error({ err }, `Command failed`);
if (isatty(process.stdout.fd)) {
console.info(await yargs.getHelp());
}
process.exit(1);
});
main().catch(async (err) => {
Logger.Instance.error({ err }, `Command failed`);
if (isatty(process.stdout.fd)) {
console.info(await yargs.getHelp());
}
process.exit(1);
});
}

0 comments on commit cb2e67d

Please sign in to comment.