Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 5 additions & 0 deletions .changeset/odd-coats-stick.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@bomb.sh/tools": patch
---

`format` CLI command respects internal format call and passes the exit code to the user.
5 changes: 3 additions & 2 deletions src/commands/format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import { local } from '../utils.ts';
const config = fileURLToPath(new URL('../../oxfmtrc.json', import.meta.url));

export async function format(ctx: CommandContext) {
const stdio = x(local('oxfmt'), ['-c', config, ...ctx.args]);
const result = x(local('oxfmt'), ['-c', config, ...ctx.args]);

for await (const line of stdio) {
for await (const line of result) {
console.info(line);
}
if (result.exitCode !== 0) process.exit(result.exitCode!);
Comment thread
jbolda marked this conversation as resolved.
Outdated
}
Loading