/
dev
executable file
·36 lines (26 loc) · 1.31 KB
/
dev
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
35
#! /usr/bin/env sh
if ! tmux has-session -t drum_practice
then
tmux new-session -s drum_practice -n Server -d
# create moar windows
tmux new-window -t drum_practice:1 -n Client
tmux new-window -t drum_practice:2 -n TestClient
tmux new-window -t drum_practice:3 -n TestServer
tmux new-window -t drum_practice:4 -n Code
tmux new-window -t drum_practice:5 -n Zsh
# run the server in the first window
tmux send-keys -t drum_practice:0.0 'cd ~/dev/rust/drum_practice/ && cargo run exec' C-m
# run the client in the second window
tmux send-keys -t drum_practice:1.0 'cd ~/dev/rust/drum_practice/frontend/ && npm run dev' C-m
# run the client tests in the third window
tmux send-keys -t drum_practice:2.0 'cd ~/dev/rust/drum_practice/frontend/ && npm run test:client' C-m
# run the server tests in the fourth window
tmux send-keys -t drum_practice:3.0 'cd ~/dev/rust/drum_practice/ && npm run test:server' C-m
# just get to the proper path for the editor
tmux send-keys -t drum_practice:4.0 'cd ~/dev/rust/drum_practice/' C-m
# just get to the proper path in the last window
tmux send-keys -t drum_practice:5.0 'cd ~/dev/rust/drum_practice/' C-m
# select the server window and pane
tmux select-window -t drum_practice:0.0
fi
tmux attach -t drum_practice