summaryrefslogtreecommitdiffhomepage
path: root/packages/desktop-electron/scripts/predev.ts
diff options
context:
space:
mode:
authorBrendan Allan <[email protected]>2026-03-04 15:12:34 +0800
committerGitHub <[email protected]>2026-03-04 15:12:34 +0800
commit5cf235fa6cf7b4c890c68f8ff68a96fcae992abf (patch)
tree25fdfd8ce95ad048fb097822995dcf060e8d6d8b /packages/desktop-electron/scripts/predev.ts
parente4f0825c56300286ec0aa82b1006e4006a17e1e1 (diff)
downloadopencode-5cf235fa6cf7b4c890c68f8ff68a96fcae992abf.tar.gz
opencode-5cf235fa6cf7b4c890c68f8ff68a96fcae992abf.zip
desktop: add electron version (#15663)
Diffstat (limited to 'packages/desktop-electron/scripts/predev.ts')
-rw-r--r--packages/desktop-electron/scripts/predev.ts17
1 files changed, 17 insertions, 0 deletions
diff --git a/packages/desktop-electron/scripts/predev.ts b/packages/desktop-electron/scripts/predev.ts
new file mode 100644
index 000000000..a688d0e7f
--- /dev/null
+++ b/packages/desktop-electron/scripts/predev.ts
@@ -0,0 +1,17 @@
+import { $ } from "bun"
+
+import { copyBinaryToSidecarFolder, getCurrentSidecar, windowsify } from "./utils"
+
+await $`bun ./scripts/copy-icons.ts ${process.env.OPENCODE_CHANNEL ?? "dev"}`
+
+const RUST_TARGET = Bun.env.RUST_TARGET
+
+const sidecarConfig = getCurrentSidecar(RUST_TARGET)
+
+const binaryPath = windowsify(`../opencode/dist/${sidecarConfig.ocBinary}/bin/opencode`)
+
+await (sidecarConfig.ocBinary.includes("-baseline")
+ ? $`cd ../opencode && bun run build --single --baseline`
+ : $`cd ../opencode && bun run build --single`)
+
+await copyBinaryToSidecarFolder(binaryPath, RUST_TARGET)