-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdev
More file actions
executable file
·34 lines (25 loc) · 816 Bytes
/
dev
File metadata and controls
executable file
·34 lines (25 loc) · 816 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/bin/env bash
set -euo pipefail
cd "$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
if ! command -v tmux &>/dev/null; then
echo "tmux is required. Install with: brew install tmux"
exit 1
fi
SESSION="refimpl-typed-api"
if tmux has-session -t "$SESSION" 2>/dev/null; then
echo "Session '$SESSION' already exists. Attaching..."
tmux attach -t "$SESSION"
exit 0
fi
for port in 3000 3001; do
pid=$(lsof -ti :"$port" 2>/dev/null || true)
if [[ -n "$pid" ]]; then
echo "Killing process $pid on port $port..."
kill "$pid" 2>/dev/null || true
fi
done
tmux new-session -d -s "$SESSION" -n dev
tmux send-keys -t "$SESSION:dev" 'npx vite client' Enter
tmux split-window -h -t "$SESSION:dev"
tmux send-keys -t "$SESSION:dev.1" 'node --watch server/server.ts' Enter
tmux attach -t "$SESSION"