From f48794c2cc717f82eac00b31157f372c7e8da359 Mon Sep 17 00:00:00 2001 From: StanPonomarev Date: Thu, 10 Sep 2026 13:44:54 +0200 Subject: [PATCH] fix install --- README.md | 7 ++----- install.sh | 2 +- tests/install.test.ts | 7 ++++--- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 49072f4..77c213b 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/install.sh b/install.sh index 4aab3d3..044317b 100755 --- a/install.sh +++ b/install.sh @@ -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" diff --git a/tests/install.test.ts b/tests/install.test.ts index 7ff5bc7..0468d2b 100644 --- a/tests/install.test.ts +++ b/tests/install.test.ts @@ -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