pass exit code on format command - #59
Conversation
🦋 Changeset detectedLatest commit: edb7fc4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
commit: |
2cf4dc6 to
edb7fc4
Compare
| for await (const line of result) { | ||
| console.info(line); | ||
| } | ||
| if (result.exitCode !== 0) process.exit(result.exitCode!); |
There was a problem hiding this comment.
maybe
| if (result.exitCode !== 0) process.exit(result.exitCode!); | |
| if (result.exitCode) process.exit(result.exitCode); |
There was a problem hiding this comment.
I thought about that, but it didn't feel appropriate to always call process.exit(). Don't love calling it either way, but kind of following precedenc.
There was a problem hiding this comment.
This suggestions just removes non-null assertion, if result.exitCode is falsy, it still skips
There was a problem hiding this comment.
What if we go with this just to be a little more explicit?
| if (result.exitCode !== 0) process.exit(result.exitCode!); | |
| if (result.exitCode && result.exitCode !== 0) process.exit(result.exitCode); |
There was a problem hiding this comment.
That could work but result.exitCode already implies that it's not 0
What does this PR do?
Passes through the exit code from the
formatcommand. Ifoxfmtfails, we will now recognize it (especially in CI).Type of change
Checklist
pnpm test)pnpm format)AI-generated code disclosure