mirror of
https://github.com/tiennm99/ccs.git
synced 2026-07-15 22:21:20 +00:00
Phase 1 - Bootstrap Scripts: - Convert lib/ccs to 32-line bootstrap (was 1919 lines) - Convert lib/ccs.ps1 to 39-line bootstrap (was 1826 lines) - Delegate all functionality to Node.js via npx Phase 2 - Help Text Updates: - Add Requirements section to Node.js help (lines 172-175) - Bootstrap scripts delegate --help to npx Phase 3 - Installer Updates: - Add Node.js 14+ detection with clear warning messages - Remove deprecated shell deps (bootstrap handles all) - Update completion messages with Requirements/First Run sections - Update docs with new architecture Total code reduction: 3745 → 71 lines (98.1%)
33 lines
896 B
Bash
Executable File
33 lines
896 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# CCS - Claude Code Switch (Bootstrap)
|
|
# Delegates to Node.js implementation via npx
|
|
# https://github.com/kaitranntt/ccs
|
|
set -euo pipefail
|
|
|
|
readonly PACKAGE="@kaitranntt/ccs"
|
|
readonly MIN_NODE_VERSION=14
|
|
|
|
# Check Node.js installed
|
|
if ! command -v node &>/dev/null; then
|
|
echo "[X] Node.js not found" >&2
|
|
echo " Install: https://nodejs.org (LTS recommended)" >&2
|
|
exit 127
|
|
fi
|
|
|
|
# Check Node.js version (major only)
|
|
node_version=$(node -v | cut -d'v' -f2 | cut -d'.' -f1)
|
|
if [[ "$node_version" -lt "$MIN_NODE_VERSION" ]]; then
|
|
echo "[X] Node.js $MIN_NODE_VERSION+ required (found: $(node -v))" >&2
|
|
echo " Update: https://nodejs.org" >&2
|
|
exit 1
|
|
fi
|
|
|
|
# Check npm/npx available
|
|
if ! command -v npx &>/dev/null; then
|
|
echo "[X] npx not found (requires npm 5.2+)" >&2
|
|
exit 127
|
|
fi
|
|
|
|
# Execute via npx (auto-installs if needed)
|
|
exec npx "$PACKAGE" "$@"
|