From 55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8 Mon Sep 17 00:00:00 2001 From: Dax Raad Date: Wed, 28 May 2025 12:53:22 -0400 Subject: add provider_list --- js/src/bun/index.ts | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 js/src/bun/index.ts (limited to 'js/src/bun') diff --git a/js/src/bun/index.ts b/js/src/bun/index.ts new file mode 100644 index 000000000..e921c825a --- /dev/null +++ b/js/src/bun/index.ts @@ -0,0 +1,25 @@ +import path from "node:path"; +import { Log } from "../util/log"; +export namespace BunProc { + const log = Log.create({ service: "bun" }); + + export function run( + cmd: string[], + options?: Bun.SpawnOptions.OptionsObject, + ) { + const root = path.resolve(process.cwd(), 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; + } +} -- cgit v1.2.3