summaryrefslogtreecommitdiffhomepage
path: root/js/src/bun
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-05-28 12:53:22 -0400
committerDax Raad <[email protected]>2025-05-28 12:53:22 -0400
commit55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8 (patch)
treeaef660f4e7b0fae135dc1f90cf6920b53238ed5b /js/src/bun
parent4132fcc1b286af5e61bf5eaa89f789988362f995 (diff)
downloadopencode-55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8.tar.gz
opencode-55a6fcdd3f5b3c55712e5cfc9dd4d994da38d4c8.zip
add provider_list
Diffstat (limited to 'js/src/bun')
-rw-r--r--js/src/bun/index.ts25
1 files changed, 25 insertions, 0 deletions
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<any, any, any>,
+ ) {
+ 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;
+ }
+}