install: add fallback to codeberg to workaround github api rate limiting

This commit is contained in:
CJ van den Berg 2025-12-02 09:57:24 +01:00
parent 77b458d4c2
commit effc5999da
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -152,11 +152,14 @@ esac
# get latest version tag from github releases api # get latest version tag from github releases api
version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name) version=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | jq -r .tag_name)
[ -z "$version" ] && { [ -z "$version" ] || [ "$version" = "null" ] && {
version=$(curl -s https://git.flow-control.dev/api/v1/repos/$repo/releases/latest | jq -r .tag_name) version=$(curl -s https://codeberg.org/api/v1/repos/neurocyte/flow-nightly/releases/latest | jq -r .tag_name)
[ -z "$version" ] && { [ -z "$version" ] || [ "$version" = "null" ] && {
echo "failed to fetch $title latest version from github or flow-control.dev" version=$(curl -s https://git.flow-control.dev/api/v1/repos/$repo/releases/latest | jq -r .tag_name)
exit 1 [ -z "$version" ] || [ "$version" = "null" ] && {
echo "failed to fetch $title latest version from github, codeberg or flow-control.dev"
exit 1
}
} }
} }
title="$title $version" title="$title $version"