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
+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"