summaryrefslogtreecommitdiffhomepage
path: root/packages/tauri/scripts/predev.ts
blob: 6b69a3ae5c5f8d3cfad8a60c45fac92b12fe425f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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`

await $`cd ../opencode && bun run build --single`

await copyBinaryToSidecarFolder(binaryPath, RUST_TARGET)