diff options
| author | Brendan Allan <[email protected]> | 2025-12-06 04:39:49 +0800 |
|---|---|---|
| committer | GitHub <[email protected]> | 2025-12-05 14:39:49 -0600 |
| commit | cd6bfb3f694675246a67dc0466d7603a37833586 (patch) | |
| tree | 9d5a4ae51553fbebd748428f1af4549c9adf8f16 /packages/tauri/scripts/prepare.ts | |
| parent | ba417d80b1174d0e289d8fc91c77a8f6a0d592f4 (diff) | |
| download | opencode-cd6bfb3f694675246a67dc0466d7603a37833586.tar.gz opencode-cd6bfb3f694675246a67dc0466d7603a37833586.zip | |
OpenCode Desktop app (#5044)
Co-authored-by: Adam <[email protected]>
Diffstat (limited to 'packages/tauri/scripts/prepare.ts')
| -rwxr-xr-x | packages/tauri/scripts/prepare.ts | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/packages/tauri/scripts/prepare.ts b/packages/tauri/scripts/prepare.ts new file mode 100755 index 000000000..c49758432 --- /dev/null +++ b/packages/tauri/scripts/prepare.ts @@ -0,0 +1,20 @@ +#!/usr/bin/env bun + +import { $ } from "bun" + +import { copyBinaryToSidecarFolder, getCurrentSidecar } from "./utils" + +const sidecarConfig = getCurrentSidecar() + +const dir = "src-tauri/target/opencode-binaries" + +await $`mkdir -p ${dir}` +await $`gh release download --pattern ${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} --repo sst/opencode --skip-existing --dir ${dir}` + +if (sidecarConfig.assetExt === "tar.gz") { + await $`tar -xvzf ${dir}/${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} -C ${dir}` +} else { + await $`unzip -o ${dir}/${sidecarConfig.ocBinary}.${sidecarConfig.assetExt} -d ${dir}` +} + +await copyBinaryToSidecarFolder(`${dir}/opencode${process.platform === "win32" ? ".exe" : ""}`) |
