@hey-api/shared 0.0.0-next-20260803131638 → 0.0.0-next-20260803133142

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -2,7 +2,7 @@ import { styleText } from "node:util";
2
2
  import fs from "node:fs";
3
3
  import path from "node:path";
4
4
  import open from "open";
5
- import { sync } from "cross-spawn";
5
+ import { xSync } from "tinyexec";
6
6
  import { coerce as coerce$1, findMinimumForRange, normalizeFull, satisfies, satisfies as satisfies$1, tryParse } from "verkit";
7
7
  import { getResolvedInput, sendRequest } from "@hey-api/json-schema-ref-parser";
8
8
  import { fromRef, log, ref } from "@hey-api/codegen-core";
@@ -853,11 +853,15 @@ function postprocessOutput(config, postProcessors, jobPrefix) {
853
853
  const name = resolved.name ?? resolved.command;
854
854
  const args = resolved.args.map((arg) => arg.replace("{{path}}", config.path));
855
855
  console.log(`${jobPrefix}🧹 Running ${styleText("cyanBright", name)}`);
856
- const result = sync(resolved.command, args);
857
- if (result.error) throw new ConfigError(`Post-processor "${name}" failed to run: ${result.error.message}`);
858
- if (result.status !== null && result.status !== 0) {
859
- let message = `Post-processor "${name}" exited with code ${result.status}`;
860
- const stderr = result.stderr?.toString().trim();
856
+ let result;
857
+ try {
858
+ result = xSync(resolved.command, args);
859
+ } catch (error) {
860
+ throw new ConfigError(`Post-processor "${name}" failed to run: ${error instanceof Error ? error.message : String(error)}`);
861
+ }
862
+ if (result.exitCode !== void 0 && result.exitCode !== 0) {
863
+ let message = `Post-processor "${name}" exited with code ${result.exitCode}`;
864
+ const stderr = result.stderr.trim();
861
865
  if (stderr) message += `:\n${stderr}`;
862
866
  throw new ConfigError(message);
863
867
  }