Skip to content

YC (S26) | Open Computer History | Continuously record your company computer work, map your workflows, help you find work worth automating, and power your agents' context

Improves version extraction in installation script (#1048)

fortran01a296dacfc593
diff --git a/install.sh b/install.sh
index b880fccdc..d675d3610 100755
--- a/install.sh
+++ b/install.sh
@@ -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