Skip to content

Commit 2e99e89

Browse files
fix: enhance GitHub API response handling for latest version detection
1 parent bc83abd commit 2e99e89

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

install-cli.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ else
4242
echo "Detecting the latest version of Kosli CLI..."
4343
debug_print "Fetching latest version from GitHub API"
4444
# Fetches the latest release tag from the GitHub API
45-
LATEST_TAG=$(curl -s "https://api.github.com/repos/kosli-dev/cli/releases/latest" | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
45+
METADATA=$(curl -s "https://api.github.com/repos/kosli-dev/cli/releases/latest")
46+
debug_print "GitHub API response: $METADATA"
47+
TAG_NAME=$(echo "$METADATA" | grep '"tag_name":')
48+
debug_print "GitHub API response tag: $TAG_NAME"
49+
LATEST_TAG=$(echo "$TAG_NAME" | sed -E 's/.*"([^"]+)".*/\1/')
4650
debug_print "GitHub API response tag: $LATEST_TAG"
4751
if [ -z "$LATEST_TAG" ]; then
4852
echo "Error: Could not fetch the latest version tag from GitHub."

0 commit comments

Comments
 (0)