fix install
This commit is contained in:
@@ -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.
|
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
|
```sh
|
||||||
curl --fail --show-error --location \
|
curl -fsSL https://git.krtss.de/StanPonomarev/stanp-opencode/raw/branch/main/install.sh | bash
|
||||||
https://git.krtss.de/StanPonomarev/stanp-opencode/raw/branch/main/install.sh \
|
|
||||||
--output install.sh
|
|
||||||
bash install.sh
|
|
||||||
```
|
```
|
||||||
|
|
||||||
From a checkout, run `bash install.sh` directly. Rerun the same script to upgrade to the latest published, non-prerelease Gitea release.
|
From a checkout, run `bash install.sh` directly. Rerun the same script to upgrade to the latest published, non-prerelease Gitea release.
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@ trap cleanup EXIT
|
|||||||
api='https://git.krtss.de/api/v1/repos/StanPonomarev/stanp-opencode/releases/latest'
|
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"
|
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
|
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"
|
curl --fail-with-body --silent --show-error --location --proto '=https' --proto-redir '=https' "$url" -o "$install/$asset"
|
||||||
done
|
done
|
||||||
read -r checksum _ < "$install/stanp-opencode.tgz.sha256"
|
read -r checksum _ < "$install/stanp-opencode.tgz.sha256"
|
||||||
|
|||||||
@@ -114,7 +114,8 @@ async function install(mode: "native" | "checksum" | "legacy") {
|
|||||||
join(directory, "release.json"),
|
join(directory, "release.json"),
|
||||||
JSON.stringify({
|
JSON.stringify({
|
||||||
tag_name: "v1.0.0",
|
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,
|
name,
|
||||||
browser_download_url: `https://fixtures.invalid/${name}`,
|
browser_download_url: `https://fixtures.invalid/${name}`,
|
||||||
})),
|
})),
|
||||||
@@ -135,8 +136,8 @@ while (($#)); do
|
|||||||
done
|
done
|
||||||
case "$url" in
|
case "$url" in
|
||||||
https://git.krtss.de/api/v1/repos/StanPonomarev/stanp-opencode/releases/latest) source=release.json ;;
|
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?asset_id=1) source=stanp-opencode.tgz ;;
|
||||||
https://fixtures.invalid/stanp-opencode.tgz.sha256) source=stanp-opencode.tgz.sha256 ;;
|
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 ;;
|
*) printf 'Unexpected fixture URL: %s\\n' "$url" >&2; exit 1 ;;
|
||||||
esac
|
esac
|
||||||
if [[ -n "$output" ]]; then
|
if [[ -n "$output" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user