Skip to content

Commit

Permalink
fix(cli): exit with non-zero error code when CLI has errors (#61)
Browse files Browse the repository at this point in the history
Allow other tools calling prismic-ts-codegen to detect errors by returning non-zero exit code from the process when errors occur.
  • Loading branch information
ck-maciek authored Oct 6, 2023
1 parent 79d9c15 commit 2f7046c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/cli/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -142,11 +142,13 @@ const main = async () => {
} else {
if (error) {
console.error(error.message);

return;
process.exit(1);
}
}
}
};

main().catch((error) => console.error(error));
main().catch((error) => {
console.error(error);
process.exit(1);
});

0 comments on commit 2f7046c

Please sign in to comment.