From 807149f7c7432f676ec867159f8be105c5de41e8 Mon Sep 17 00:00:00 2001 From: h3p Date: Wed, 11 Feb 2026 12:02:26 +0100 Subject: [PATCH] install: parse GitHub release assets via JSON for reliable one-line install --- scripts/install.sh | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/scripts/install.sh b/scripts/install.sh index 9150a31..dae5040 100755 --- a/scripts/install.sh +++ b/scripts/install.sh @@ -52,10 +52,28 @@ echo "Fetching latest release metadata for ${REPO}..." RELEASE_JSON="$(curl -fsSL "https://api.github.com/repos/${REPO}/releases/latest")" # Prefer the actual app assets, not the source zipball. -ASSET_URL="$(printf '%s' "${RELEASE_JSON}" | grep -Eo '"browser_download_url":[^"]+"[^"]+"' | grep -Eo 'https://[^"]+' | grep -E 'Neon\\.Vision\\.Editor\\.app\\.(zip|dmg)$' | head -n 1 || true)" -if [ -z "${ASSET_URL}" ]; then - ASSET_URL="$(printf '%s' "${RELEASE_JSON}" | grep -Eo '"browser_download_url":[^"]+"[^"]+"' | grep -Eo 'https://[^"]+' | grep -E '\\.(zip|dmg)$' | head -n 1 || true)" -fi +ASSET_URL="$(printf '%s' "${RELEASE_JSON}" | python3 -c ' +import json +import re +import sys + +try: + release = json.load(sys.stdin) +except Exception: + print("") + raise SystemExit(0) + +assets = release.get("assets") or [] +urls = [a.get("browser_download_url", "") for a in assets if isinstance(a, dict)] + +preferred = next((u for u in urls if re.search(r"Neon\.Vision\.Editor\.app\.(zip|dmg)$", u)), "") +if preferred: + print(preferred) + raise SystemExit(0) + +fallback = next((u for u in urls if re.search(r"\.(zip|dmg)$", u)), "") +print(fallback) +')" if [ -z "${ASSET_URL}" ]; then echo "Could not find an app .zip or .dmg asset in the latest release." >&2 exit 1