Files
gstack/install.sh
T
Garry Tan fed0a4b521 feat: one-liner installer + setup install ping
- install.sh: curl-pipe-bash installer with prereq checks (git, bun),
  upgrade detection (git pull if already installed), transparency note
  about update-check pings
- setup: add install ping at end (gstack-update-check --force) to
  register day-zero installs in Supabase
- Install ping only in setup (not install.sh) to avoid double-counting
  (Codex review fix #7)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 15:49:27 -07:00

51 lines
1.7 KiB
Bash
Executable File

#!/usr/bin/env bash
# gstack installer — curl-pipe-bash one-liner
#
# Usage:
# bash <(curl -fsSL https://raw.githubusercontent.com/garrytan/gstack/main/install.sh)
#
set -euo pipefail
INSTALL_DIR="$HOME/.claude/skills/gstack"
echo "gstack installer"
echo "━━━━━━━━━━━━━━━━"
echo ""
# ─── Check prereqs ────────────────────────────────────────────
for cmd in git bun; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo "Error: $cmd is required but not found."
case "$cmd" in
git) echo " Install: https://git-scm.com/downloads" ;;
bun) echo " Install: curl -fsSL https://bun.sh/install | bash" ;;
esac
exit 1
fi
done
# Claude CLI check (warn, don't fail — they might install it after)
if ! command -v claude >/dev/null 2>&1; then
echo "Warning: Claude CLI not found."
echo " Install: npm install -g @anthropic-ai/claude-code"
echo " (gstack requires Claude Code to run skills)"
echo ""
fi
# ─── Fresh install vs upgrade ─────────────────────────────────
if [ -d "$INSTALL_DIR/.git" ]; then
echo "gstack already installed — upgrading..."
cd "$INSTALL_DIR" && git pull origin main && ./setup
else
echo "Installing gstack to $INSTALL_DIR..."
mkdir -p "$(dirname "$INSTALL_DIR")"
git clone https://github.com/garrytan/gstack.git "$INSTALL_DIR"
cd "$INSTALL_DIR" && ./setup
fi
echo ""
echo "Note: gstack checks for updates by pinging our server with your"
echo "version number, OS, and a random device ID. No usage data is sent."
echo ""
echo "gstack installed! Try: /office-hours"