dotfiles/.config/fish/functions/vitally-start.fish

21 lines
875 B
Fish
Raw Normal View History

2024-03-15 14:08:15 -04:00
function vitally-start
set session $(vitally session-name)
set workdir $(pwd)
vitally stop
tmux new-session -d -s $session -c $workdir
tmux new-window -t "$session:" -n "build" -c $workdir
tmux new-window -t "$session:" -n "client" -c $workdir
tmux new-window -t "$session:" -n "server" -c $workdir
tmux new-window -t "$session:" -n "surveys-api" -c $workdir
tmux new-window -t "$session:" -n "job-runner" -c $workdir
tmux send-keys -t "$session:build" "yarn migrate" Enter
tmux send-keys -t "$session:build" "yarn build:watch" Enter
tmux send-keys -t "$session:client" "sleep 30; yarn client:start" Enter
tmux send-keys -t "$session:server" "sleep 35; yarn server:start" Enter
tmux send-keys -t "$session:surveys-api" "sleep 35; yarn surveys:start" Enter
tmux send-keys -t "$session:job-runner" "sleep 40; yarn job-runner:start" Enter
end