#!/usr/bin/env bash set -euo pipefail DOWNLOAD_BASE="https://getpolyscope.com/download/server/linux" case "$(uname -m)" in x86_64|amd64) SERVER_ARCH="x64" ;; aarch64|arm64) SERVER_ARCH="arm64" ;; *) echo "Unsupported CPU architecture: $(uname -m). Supported: x86_64/amd64 (x64), aarch64/arm64 (arm64)." >&2 exit 1 ;; esac DOWNLOAD_URL="${DOWNLOAD_BASE}/${SERVER_ARCH}" INSTALL_DIR="${POLYSCOPE_INSTALL_DIR:-$HOME/.local/bin}" BINARY="$INSTALL_DIR/polyscope-server" echo "Downloading polyscope-server (${SERVER_ARCH})..." mkdir -p "$INSTALL_DIR" curl -fsSL "$DOWNLOAD_URL" -o "$BINARY" chmod +x "$BINARY" echo "" echo "Installed polyscope-server to $BINARY" # Check if install dir is in PATH if [[ ":$PATH:" != *":$INSTALL_DIR:"* ]]; then echo "" echo "Note: $INSTALL_DIR is not in your PATH." echo "Add it by running:" echo "" echo " export PATH=\"$INSTALL_DIR:\$PATH\"" echo "" fi echo "" echo "Next steps:" echo " 1. polyscope-server login # Authenticate with your Polyscope account" echo " 2. polyscope-server # Start the server" echo "" echo "Tip: To keep polyscope-server running in the background, use a process" echo "manager like supervisord or systemd. See our docs for details:" echo " https://getpolyscope.com/docs/getting-started/standalone-server" echo ""