#!/usr/bin/env bash # snotes CLI installer — rendered by the server for user "__SNOTES_USER__". # Usage: curl -fsSL __SNOTES_URL__/__SNOTES_USER__/cli | bash set -euo pipefail SNOTES_URL="__SNOTES_URL__" SNOTES_USER="__SNOTES_USER__" BIN_DIR="$HOME/.local/bin" CFG_DIR="$HOME/.config/snotes" if ! command -v uv >/dev/null 2>&1; then echo "snotes needs 'uv' to run (https://docs.astral.sh/uv/)." >&2 echo "Install it first: curl -LsSf https://astral.sh/uv/install.sh | sh" >&2 exit 1 fi mkdir -p "$BIN_DIR" "$CFG_DIR" echo "Downloading snotes CLI from $SNOTES_URL ..." curl -fsSL "$SNOTES_URL/cli/snotes.py" -o "$BIN_DIR/snotes" chmod +x "$BIN_DIR/snotes" umask 077 cat > "$CFG_DIR/config.json" <