diff options
| author | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-21 03:13:28 +0300 |
|---|---|---|
| committer | Ogulcan Celik <ogulcancelik@gmail.com> | 2026-05-21 03:14:28 +0300 |
| commit | 3769dcbb323d600dd40166413c46deb0894d1f4a (patch) | |
| tree | 1623192a3ab7f697f86fb6ff742e88d812e85971 /website/install.sh | |
| parent | 7515695a1996e9b406a3cf1eef43208c6c248929 (diff) | |
fix: version latest manifest metadata
Diffstat (limited to 'website/install.sh')
| -rwxr-xr-x | website/install.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/website/install.sh b/website/install.sh index 579f8325..81c583ac 100755 --- a/website/install.sh +++ b/website/install.sh @@ -32,7 +32,7 @@ main() { # check dependencies need curl - need sed + need awk # use the same manifest as `herdr update` so installs and updates agree # on the public latest release. @@ -40,8 +40,17 @@ main() { log "fetching latest release manifest..." MANIFEST="$(curl -fsSL --retry 3 --connect-timeout 10 --max-time 20 "$MANIFEST_URL")" \ || err "can't reach ${MANIFEST_URL}. Please try again later; herdr.dev might be down. Who let the sheeps out? baaa." - URL="$(printf '%s\n' "$MANIFEST" | sed -n "s/.*\"${TARGET}\"[[:space:]]*:[[:space:]]*\"\([^\"]*\)\".*/\1/p")" - VERSION="$(printf '%s\n' "$MANIFEST" | sed -n 's/.*"version"[[:space:]]*:[[:space:]]*"\([^"]*\)".*/\1/p')" + URL="$(printf '%s\n' "$MANIFEST" | awk -v target="\"${TARGET}\"" ' + /^[[:space:]]*"assets"[[:space:]]*:/ { in_assets = 1; next } + in_assets && /^[[:space:]]*}/ { exit } + in_assets && index($0, target) { + sub(/^.*:[[:space:]]*"/, "") + sub(/".*$/, "") + print + exit + } + ')" + VERSION="$(printf '%s\n' "$MANIFEST" | awk -F '"' '/^[[:space:]]*"version"[[:space:]]*:/ { print $4; exit }')" if [ -z "$URL" ]; then err "release manifest does not include a binary for ${TARGET}" |
