Files
archy/packages/app/scripts/dev.sh
T

31 lines
653 B
Bash
Raw Normal View History

#!/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)"
cd "$APP_DIR"
cleanup() {
kill 0 2>/dev/null || true
wait 2>/dev/null || true
}
trap cleanup EXIT INT TERM
# Use local node_modules binaries
BIN="$APP_DIR/node_modules/.bin"
# Start Claude proxy in background
"$BIN/tsx" server/claude-proxy.ts &
sleep 0.3
# Start Vite dev server in background
"$BIN/vite" --host &
# Wait for all background jobs (compatible with bash 3.2 on macOS)
wait