#!/bin/bash set -e # gitspine installer # Usage: curl -fsSL https://gitspine.com/install.sh | bash VERSION="9fa77c0-20260211" BASE_URL="https://gitspine.com/downloads" # Detect OS and architecture OS=$(uname -s | tr '[:upper:]' '[:lower:]') ARCH=$(uname -m) case "$OS" in darwin) case "$ARCH" in arm64) PLATFORM="macos-arm64" ;; x86_64) PLATFORM="macos-x86_64" ;; *) echo "Error: Unsupported architecture: $ARCH" exit 1 ;; esac ;; linux) case "$ARCH" in x86_64) PLATFORM="linux-x86_64" ;; *) echo "Error: Unsupported architecture: $ARCH" exit 1 ;; esac ;; *) echo "Error: Unsupported OS: $OS" exit 1 ;; esac FILENAME="gitspine-${PLATFORM}-${VERSION}.tar.gz" URL="${BASE_URL}/${FILENAME}" # Determine install location if [ -w /usr/local/bin ]; then INSTALL_DIR="/usr/local/bin" else INSTALL_DIR="$HOME/.local/bin" mkdir -p "$INSTALL_DIR" fi echo "Downloading gitspine for ${PLATFORM}..." TMPDIR=$(mktemp -d) curl -fsSL "$URL" -o "$TMPDIR/$FILENAME" echo "Installing to ${INSTALL_DIR}..." tar -xzf "$TMPDIR/$FILENAME" -C "$TMPDIR" mv "$TMPDIR/gitspine" "$INSTALL_DIR/gitspine" chmod +x "$INSTALL_DIR/gitspine" # Cleanup rm -rf "$TMPDIR" # Check if install dir is in PATH if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then echo "" echo "Note: Add $INSTALL_DIR to your PATH:" echo " export PATH=\"$INSTALL_DIR:\$PATH\"" echo "" fi echo "Done! Run 'gitspine' in any git repository to get started." echo "" echo "Free trial: 14 days. Purchase a license at https://gitspine.com"