summaryrefslogtreecommitdiffhomepage
path: root/packages/tauri/scripts/predev.ts
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2025-12-06 04:39:49 +0800
committerGitHub <[email protected]>2025-12-05 14:39:49 -0600
commitcd6bfb3f694675246a67dc0466d7603a37833586 (patch)
tree9d5a4ae51553fbebd748428f1af4549c9adf8f16 /packages/tauri/scripts/predev.ts
parentba417d80b1174d0e289d8fc91c77a8f6a0d592f4 (diff)
downloadopencode-cd6bfb3f694675246a67dc0466d7603a37833586.tar.gz
opencode-cd6bfb3f694675246a67dc0466d7603a37833586.zip
OpenCode Desktop app (#5044)
Co-authored-by: Adam <[email protected]>
Diffstat (limited to 'packages/tauri/scripts/predev.ts')
-rw-r--r--packages/tauri/scripts/predev.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/tauri/scripts/predev.ts b/packages/tauri/scripts/predev.ts
new file mode 100644
index 000000000..bd9320a4a
--- /dev/null
+++ b/packages/tauri/scripts/predev.ts
@@ -0,0 +1,17 @@
+import * as fs from "node:fs/promises"
+import { $ } from "bun"
+
+import { copyBinaryToSidecarFolder, getCurrentSidecar } from "./utils"
+
+const RUST_TARGET = Bun.env.TAURI_ENV_TARGET_TRIPLE
+
+const sidecarConfig = getCurrentSidecar(RUST_TARGET)
+
+const binaryPath = `../opencode/dist/${sidecarConfig.ocBinary}/bin/opencode`
+
+if (!(await fs.exists(binaryPath))) {
+ console.log("opencode binary not found, building...")
+ await $`cd ../opencode && bun run build --single`
+}
+
+await copyBinaryToSidecarFolder(binaryPath, RUST_TARGET)