#!/bin/bash
set -euo pipefail
if ! command -v claude >/dev/null 2>&1; then
  if ! command -v npm >/dev/null 2>&1; then
    echo 'Install Node.js LTS from https://nodejs.org/en/download, open a new terminal and run this file again.'
    exit 1
  fi
  npm install -g @anthropic-ai/claude-code
fi
setup=$(mktemp)
trap 'rm -f "$setup"' EXIT
curl -fsSL https://claud.sale/install/claude.sh -o "$setup"
bash "$setup"
printf '\nOpen a new terminal and run: claude\n'
read -r -p 'Press Enter to close.'
