From edb7fc460cc13728097d8e205c54c2964f077f06 Mon Sep 17 00:00:00 2001 From: Jacob Bolda Date: Sun, 26 Jul 2026 23:00:27 -0500 Subject: [PATCH] pass exit code on format command --- .changeset/odd-coats-stick.md | 5 +++++ src/commands/format.ts | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 .changeset/odd-coats-stick.md diff --git a/.changeset/odd-coats-stick.md b/.changeset/odd-coats-stick.md new file mode 100644 index 0000000..ccb2a21 --- /dev/null +++ b/.changeset/odd-coats-stick.md @@ -0,0 +1,5 @@ +--- +"@bomb.sh/tools": patch +--- + +`format` CLI command respects internal format call and passes the exit code to the user. diff --git a/src/commands/format.ts b/src/commands/format.ts index 4e015d5..9269e22 100644 --- a/src/commands/format.ts +++ b/src/commands/format.ts @@ -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!); }