From c4de2dc2eec339029cdbf80e8cd76da01bc8f8c1 Mon Sep 17 00:00:00 2001 From: abdalrahmanf2 Date: Fri, 4 Jul 2025 02:12:35 +0300 Subject: [PATCH 1/2] fix(curl): curl wasn't following redirects from cursor's api --- shell/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/functions.sh b/shell/functions.sh index 6faf393..54b91a2 100755 --- a/shell/functions.sh +++ b/shell/functions.sh @@ -6,7 +6,7 @@ function download_cursor() { # Get the download URL from the API echo -e "🔍 ${CYAN}Fetching latest Cursor version...${NC}" - APPIMAGE_URL=$(curl -s "$URL_CURSOR_DOWN" | grep -o '"downloadUrl":"[^"]*"' | cut -d'"' -f4) + APPIMAGE_URL=$(curl -s -L "$URL_CURSOR_DOWN" | grep -o '"downloadUrl":"[^"]*"' | cut -d'"' -f4) # Extract the version from the URL VERSION=$(echo "$APPIMAGE_URL" | grep -o 'Cursor-[0-9.]*' | cut -d'-' -f2) From 44943a40d679e095af997614169a7f6df576e57a Mon Sep 17 00:00:00 2001 From: abdalrahmanf2 Date: Fri, 4 Jul 2025 18:31:50 +0300 Subject: [PATCH 2/2] fix: curl redirects in the update function --- shell/functions.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/functions.sh b/shell/functions.sh index 54b91a2..e2bec8c 100755 --- a/shell/functions.sh +++ b/shell/functions.sh @@ -110,7 +110,7 @@ APPDIR=/opt/cursor API_URL="$URL_CURSOR_DOWN" # Get the download URL from the API -APPIMAGE_URL=\$(curl -s "\$API_URL" | grep -o '"downloadUrl":"[^"]*"' | cut -d'"' -f4) +APPIMAGE_URL=\$(curl -s -L "\$API_URL" | grep -o '"downloadUrl":"[^"]*"' | cut -d'"' -f4) # Extract the version from the URL VERSION=\$(echo "\$APPIMAGE_URL" | grep -o 'Cursor-[0-9.]*' | cut -d'-' -f2)