OpenCode Desktop app (#5044)
Co-authored-by: Adam <2363879+adamdotdevin@users.noreply.github.com>
This commit is contained in:
17
packages/tauri/scripts/predev.ts
Normal file
17
packages/tauri/scripts/predev.ts
Normal file
@@ -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)
|
||||
Reference in New Issue
Block a user