Merge pull request #11 from abdalrahmanf2/fix/curl-redirects

fix(curl): curl wasn't following redirects from cursor's api
This commit is contained in:
Jhosua Rengel
2025-07-04 11:18:50 -05:00
committed by GitHub

View File

@@ -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)
@@ -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)