#!/usr/bin/env bash RELEASES_URL="https://api.github.com/repos/go-gitea/gitea/releases/latest" RELEASE_URLS=$(curl --silent "${RELEASES_URL}" | jq -r '.assets[] | select (.name|test("linux-amd64")) | .browser_download_url') DOWNLOAD_URL=$(echo "${RELEASE_URLS}" | egrep "linux\-amd64$") stat "gitea-linux-amd64" || \ wget "${DOWNLOAD_URL}" -O "gitea-linux-amd64"