Skip to content

Commit

Permalink
Switch to 3
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewbranch committed Nov 3, 2023
1 parent 6a516c1 commit 5dba9a9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .changeset/angry-timers-shave.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@arethetypeswrong/cli": patch
---

Use exit code 127 for errors, 1 for failures
Use exit code 3 for errors, 1 for failures
4 changes: 2 additions & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -234,12 +234,12 @@ program.parse(process.argv);
function handleError(error: unknown, title: string): never {
if (error && typeof error === "object" && "message" in error) {
program.error(`error while ${title}:\n${error.message}`, {
exitCode: 127,
exitCode: 3,
code: "code" in error && typeof error.code === "string" ? error.code : "UNKNOWN",
});
}

program.error(`unknown error while ${title}`, { code: "UNKNOWN", exitCode: 127 });
program.error(`unknown error while ${title}`, { code: "UNKNOWN", exitCode: 3 });
}

process.on("unhandledRejection", (error) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/test/snapshots/Babel@0.0.1.tgz.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ Expected double-quoted property name in JSON at position 450
```

Exit code: 127
Exit code: 3

0 comments on commit 5dba9a9

Please sign in to comment.