@@ -13,28 +13,23 @@ if ! command -v jq >/dev/null 2>&1; then
1313 exit 1
1414fi
1515
16- # API_ENDPOINT="https://api.github.com/repos/stacklok/toolhive/releases/latest"
16+ API_ENDPOINT=" https://api.github.com/repos/stacklok/toolhive/releases/latest"
1717
1818# Fetch release information
19- # RELEASE_JSON=$(curl -sf "$API_ENDPOINT" || {
20- # echo "Failed to fetch release information from GitHub API"
21- # exit 1
22- # })
23- # RELEASE_VERSION=$(echo "$RELEASE_JSON" | jq -r '.tag_name // empty' | sed 's/^v//')
24- # RELEASE_TARBALL=$(echo "$RELEASE_JSON" | jq -r \
25- # --arg version "$RELEASE_VERSION" \
26- # '.assets[] | select(.name == "toolhive_" + $version + "_linux_amd64.tar.gz") | .browser_download_url // empty')
27-
28- # if [ -z "$RELEASE_TARBALL" ]; then
29- # echo "Failed to get release tarball URL for release: ${RELEASE_VERSION}"
30- # echo "Please check if the tag exists in the repository"
31- # exit 1
32- # fi
33-
34- # Temporary fix for early exit if container runtime isn't found
19+ RELEASE_JSON=$( curl -sf " $API_ENDPOINT " || {
20+ echo " Failed to fetch release information from GitHub API"
21+ exit 1
22+ })
23+ RELEASE_VERSION=$( echo " $RELEASE_JSON " | jq -r ' .tag_name // empty' | sed ' s/^v//' )
24+ RELEASE_TARBALL=$( echo " $RELEASE_JSON " | jq -r \
25+ --arg version " $RELEASE_VERSION " \
26+ ' .assets[] | select(.name == "toolhive_" + $version + "_linux_amd64.tar.gz") | .browser_download_url // empty' )
3527
36- RELEASE_VERSION=" v0.2.17"
37- RELEASE_TARBALL=" https://github.com/stacklok/toolhive/releases/download/v0.2.17/toolhive_0.2.17_linux_amd64.tar.gz"
28+ if [ -z " $RELEASE_TARBALL " ]; then
29+ echo " Failed to get release tarball URL for release: ${RELEASE_VERSION} "
30+ echo " Please check if the tag exists in the repository"
31+ exit 1
32+ fi
3833
3934# Determine installation location based on write permissions
4035if [[ -w " /usr/local/bin" ]]; then
0 commit comments