diff --git a/install.sh b/install.sh index 4ab7a41..061f8c3 100755 --- a/install.sh +++ b/install.sh @@ -30,15 +30,11 @@ fi # 2. Get latest release tag from Gitea API # ----------------------------------------------------------------------------- -REPO_API="https://gitea.jde.nz/api/v1/repos/j/bb64/releases" +REPO_API="https://gitea.jde.nz/api/v1/repos/j/bb64/releases/latest" if command -v jq >/dev/null 2>&1; then - TAG=$(curl -s "$REPO_API" | jq -r '.[0].tag_name') + TAG=$(curl -s "$REPO_API" | jq -r '.tag_name') else - TAG=$(curl -s "$REPO_API" | grep -m1 '"tag_name"' | sed 's/.*"tag_name"[ ]*:[ ]*"\([^"]*\)".*/\1/') -fi -if [ -z "$TAG" ] || [ "$TAG" = "null" ]; then - echo "Could not determine latest release tag from $REPO_API" >&2 - exit 1 + TAG=$(curl -s "$REPO_API" | grep -o '"tag_name"[ ]*:[ ]*\"[^\"]*\"' | head -1 | sed 's/.*: *\"\\([^\"]*\\)\"/\\1/') fi echo "Latest version of bb64 is: $TAG"