Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve version extraction logic in fetch_latest_version script. #1042

Closed

Conversation

fortran01
Copy link
Contributor

[pr] fix: improve version parsing reliability in install script

description

This PR improves the version parsing logic in the installation script to make it more reliable when fetching the latest version from GitHub. The changes handle potential formatting issues in the JSON response by:

  • Removing newlines that could interfere with grep
  • Using a more precise grep pattern for tag_name
  • Simplifying the string processing pipeline

related issue: # (no related issue)

how to test

  1. Delete any existing screenpipe installation
  2. Run the installation script:
    curl -fsSL raw.githubusercontent.com/fortran01/screenpipe/fix/install-script-version-parsing/install.sh | sh
  3. Verify that the script successfully:
  • Fetches the latest version
  • Downloads and installs the correct version
  • Does not show "failed to fetch latest version" error

Copy link

vercel bot commented Dec 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
screenpipe ✅ Ready (Inspect) Visit Preview 💬 Add feedback Dec 24, 2024 11:18pm

@louis030195
Copy link
Collaborator

Screenshot 2024-12-24 at 8 55 57 AM

Updates GitHub release version parsing logic to work reliably across different platforms

Uses grep and sed for more robust version number extraction from API response:

The new approach is more reliable because:

- It doesn't depend on platform-specific behavior of text processing tools
- It's more tolerant of formatting variations in the JSON response
- It uses fewer pipe operations, reducing the chance of errors
@fortran01
Copy link
Contributor Author

I got it. I'm on Mac, and you are on Linux. Created a new one #1048

@fortran01 fortran01 closed this Dec 24, 2024
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.

2 participants