Skip to content

Commit

Permalink
Improves version extraction in installation script (#1048)
Browse files Browse the repository at this point in the history
Updates version parsing logic to use more robust grep and sed approach

Enhances cross-platform compatibility for extracting GitHub release version
Removes potential parsing inconsistencies in version extraction
  • Loading branch information
fortran01 authored Dec 26, 2024
1 parent 2c66826 commit a296dac
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ get_os_arch() {

echo "fetching latest version from github..."
LATEST_RELEASE=$(curl -s https://api.github.com/repos/mediar-ai/screenpipe/releases/latest)
VERSION=$(echo "$LATEST_RELEASE" | grep -o '"tag_name": "v[^"]*"' | cut -d'"' -f4 | sed 's/^v//')

# Extract version using grep and sed for cross-platform compatibility
VERSION=$(echo "$LATEST_RELEASE" | grep -o '"tag_name": *"v[^"]*"' | sed 's/.*"v\([^"]*\)".*/\1/')
if [ -z "$VERSION" ]; then
echo "failed to fetch latest version"
exit 1
Expand Down

0 comments on commit a296dac

Please sign in to comment.