This commit is contained in:
Dax Raad
2025-05-30 20:47:56 -04:00
parent 9a26b3058f
commit f3da73553c
178 changed files with 765 additions and 3382 deletions

View File

@@ -0,0 +1,28 @@
import path from "path";
import { Log } from "../util/log";
export namespace BunProc {
const log = Log.create({ service: "bun" });
export function run(
cmd: string[],
options?: Bun.SpawnOptions.OptionsObject<any, any, any>,
) {
const root =
process.argv0 !== "bun"
? path.resolve(process.cwd(), process.argv0)
: process.argv0;
log.info("running", {
cmd: [root, ...cmd],
options,
});
const result = Bun.spawnSync([root, ...cmd], {
...options,
argv0: "bun",
env: {
...process.env,
...options?.env,
},
});
return result;
}
}