mirror of
https://github.com/anomalyco/opencode.git
synced 2026-02-01 22:48:16 +00:00
18 lines
527 B
TypeScript
18 lines
527 B
TypeScript
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)
|