Feat: improve robustness of version extraction and update download URL #32
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:
DOWNLOAD_URL
to a more specific production URL and increased theVERSION_CHECK_TIMEOUT
from 5 seconds to 360 seconds to accommodate slower connections.Improvements to version extraction:
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:
fetch_remote_version
to extract the filename directly from theDOWNLOAD_URL
if HTTP headers do not provide it, and added a fallback to use the basename of theDOWNLOAD_URL
when filename information is missing.find_local_version
function to search for files with a more consistent naming pattern (Cursor-*.AppImage
instead ofcursor-*.AppImage
).