2026-03-02 23:50:46 +00:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
# Start Claude proxy and Vite dev server together.
|
|
|
|
|
# Both are killed when either exits or when this script receives SIGINT/SIGTERM.
|
|
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
|
|
SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
|
|
|
|
|
APP_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"
|
|
|
|
|
|
2026-03-03 00:27:51 +00:00
|
|
|
cd "$APP_DIR"
|
|
|
|
|
|
2026-03-02 23:50:46 +00:00
|
|
|
cleanup() {
|
|
|
|
|
kill 0 2>/dev/null || true
|
|
|
|
|
wait 2>/dev/null || true
|
|
|
|
|
}
|
|
|
|
|
trap cleanup EXIT INT TERM
|
|
|
|
|
|
2026-03-03 00:27:51 +00:00
|
|
|
# Use local node_modules binaries
|
|
|
|
|
BIN="$APP_DIR/node_modules/.bin"
|
|
|
|
|
|
2026-03-02 23:50:46 +00:00
|
|
|
# Start Claude proxy in background
|
2026-03-03 00:27:51 +00:00
|
|
|
"$BIN/tsx" server/claude-proxy.ts &
|
2026-03-02 23:50:46 +00:00
|
|
|
|
|
|
|
|
sleep 0.3
|
|
|
|
|
|
2026-03-03 00:27:51 +00:00
|
|
|
# Start Vite dev server in background
|
|
|
|
|
"$BIN/vite" --host &
|
2026-03-02 23:50:46 +00:00
|
|
|
|
2026-03-03 00:27:51 +00:00
|
|
|
# Wait for all background jobs (compatible with bash 3.2 on macOS)
|
|
|
|
|
wait
|