From 688cb97ad5ed8fc0fc16cdffd6fb2954c43b9ae4 Mon Sep 17 00:00:00 2001 From: CJ van den Berg Date: Wed, 22 Oct 2025 13:01:59 +0200 Subject: [PATCH] install: use jq for parsing json API responses and fallback to flow-control.dev if github is limited or down --- assets/install | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/assets/install b/assets/install index 9c49adb..ce106f7 100644 --- a/assets/install +++ b/assets/install @@ -152,10 +152,13 @@ i386) arch="x86" ;; esac # get latest version tag from github releases api -version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep '"tag_name":' | cut -d'"' -f4) +version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name) [ -z "$version" ] && { - echo "failed to fetch $title latest version" - exit 1 + version=$(curl -s https://git.flow-control.dev/api/v1/repos/$repo/releases/latest | jq -r .tag_name) + [ -z "$version" ] && { + echo "failed to fetch $title latest version from github or flow-control.dev" + exit 1 + } } title="$title $version"