fix install

This commit is contained in:
2026-09-10 13:44:54 +02:00
parent bb95f9334b
commit f48794c2cc
3 changed files with 7 additions and 9 deletions
+2 -5
View File
@@ -6,13 +6,10 @@ OpenCode V2 plugin providing a `coordinate` agent and fast/good/deep worker pair
Requires **OpenCode V2** (`opencode2`), **Bun 1.3.14+**, Bash, curl, jq, and `sha256sum` (Linux/WSL). The native plugin API is pinned to `@opencode/plugin@0.0.0-beta-19378`; use the matching OpenCode beta.
Download and inspect [install.sh](install.sh), then run it without sudo:
Run the installer without sudo:
```sh
curl --fail --show-error --location \
https://git.krtss.de/StanPonomarev/stanp-opencode/raw/branch/main/install.sh \
--output install.sh
bash install.sh
curl -fsSL https://git.krtss.de/StanPonomarev/stanp-opencode/raw/branch/main/install.sh | bash
```
From a checkout, run `bash install.sh` directly. Rerun the same script to upgrade to the latest published, non-prerelease Gitea release.
+1 -1
View File
@@ -18,7 +18,7 @@ trap cleanup EXIT
api='https://git.krtss.de/api/v1/repos/StanPonomarev/stanp-opencode/releases/latest'
curl --fail-with-body --silent --show-error --location --proto '=https' --proto-redir '=https' "$api" -o "$install/release.json"
for asset in stanp-opencode.tgz stanp-opencode.tgz.sha256; do
url=$(jq -er --arg name "$asset" '[.assets[] | select(.name == $name) | .browser_download_url] | if length == 1 then .[0] | select(type == "string" and startswith("https://")) else error("Missing or duplicate release asset: " + $name) end' "$install/release.json")
url=$(jq -er --arg name "$asset" '[.assets[] | select(.name == $name)] | if length == 1 then .[0] | select((.id | type) == "number" and (.browser_download_url | type) == "string" and (.browser_download_url | startswith("https://"))) | "\(.browser_download_url)?asset_id=\(.id)" else error("Missing or duplicate release asset: " + $name) end' "$install/release.json")
curl --fail-with-body --silent --show-error --location --proto '=https' --proto-redir '=https' "$url" -o "$install/$asset"
done
read -r checksum _ < "$install/stanp-opencode.tgz.sha256"
+4 -3
View File
@@ -114,7 +114,8 @@ async function install(mode: "native" | "checksum" | "legacy") {
join(directory, "release.json"),
JSON.stringify({
tag_name: "v1.0.0",
assets: ["stanp-opencode.tgz", "stanp-opencode.tgz.sha256"].map((name) => ({
assets: ["stanp-opencode.tgz", "stanp-opencode.tgz.sha256"].map((name, id) => ({
id: id + 1,
name,
browser_download_url: `https://fixtures.invalid/${name}`,
})),
@@ -135,8 +136,8 @@ while (($#)); do
done
case "$url" in
https://git.krtss.de/api/v1/repos/StanPonomarev/stanp-opencode/releases/latest) source=release.json ;;
https://fixtures.invalid/stanp-opencode.tgz) source=stanp-opencode.tgz ;;
https://fixtures.invalid/stanp-opencode.tgz.sha256) source=stanp-opencode.tgz.sha256 ;;
https://fixtures.invalid/stanp-opencode.tgz?asset_id=1) source=stanp-opencode.tgz ;;
https://fixtures.invalid/stanp-opencode.tgz.sha256?asset_id=2) source=stanp-opencode.tgz.sha256 ;;
*) printf 'Unexpected fixture URL: %s\\n' "$url" >&2; exit 1 ;;
esac
if [[ -n "$output" ]]; then