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!); }