Skip to content

Feat: improve robustness of version extraction and update download URL#32

Open
umarijaz04 wants to merge 1 commit into
jorcelinojunior:mainfrom
umarijaz04:patch-1
Open

Feat: improve robustness of version extraction and update download URL#32
umarijaz04 wants to merge 1 commit into
jorcelinojunior:mainfrom
umarijaz04:patch-1

Conversation

@umarijaz04

@umarijaz04 umarijaz04 commented May 21, 2025

Copy link
Copy Markdown

This pull request updates the cursor_setup.sh script to enhance its robustness, improve version extraction, and address edge cases in handling the download URL and file metadata. The key changes include updating URLs and timeout values, refining version extraction logic, and improving fallback mechanisms for remote version and filename retrieval.

Updates to constants and configuration:

  • Updated DOWNLOAD_URL to a more specific production URL and increased the VERSION_CHECK_TIMEOUT from 5 seconds to 360 seconds to accommodate slower connections.

Improvements to version extraction:

  • Enhanced the extract_version function to handle variations in filename patterns (e.g., "Cursor-0.49.6" or "cursor_0.49.6") and added a fallback to a default version ("0.49.6") if no version is found.

Enhancements to remote version and filename handling:

  • Updated fetch_remote_version to extract the filename directly from the DOWNLOAD_URL if HTTP headers do not provide it, and added a fallback to use the basename of the DOWNLOAD_URL when filename information is missing.
  • Adjusted the find_local_version function to search for files with a more consistent naming pattern (Cursor-*.AppImage instead of cursor-*.AppImage).

@umarijaz04 umarijaz04 changed the title Update cursor_setup.sh Feat: improve robustness of version extraction and update download URL May 21, 2025
@Vincent14

Copy link
Copy Markdown

You could even rely on https://github.com/oslook/cursor-ai-downloads @umarijaz04

@Vincent14

Copy link
Copy Markdown

With your changes I got

 ▶  Looking for the latest version online...
 ✔  Latest version details retrieved successfully.
Error: No version found in filename

@umarijaz04

umarijaz04 commented May 22, 2025

Copy link
Copy Markdown
Author

@Vincent14, https://github.com/oslook/cursor-ai-downloads, I have tried this before, and it is not running on Ubuntu 24.04.2 LTS. It only runs with the no-sandbox flag, which doesn't even connect the accounts.

@Vincent14, it works on my end, and I have changed the cursor URL to the latest version. Please see the screenshot below.

2025-05-22_18-39

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants