Created
April 6, 2020 03:17
-
-
Save chuyeow/128e770580178b7785cadad0d27da906 to your computer and use it in GitHub Desktop.
Tmux script example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
cd $GOPATH/src/code.in.spdigital.sg/sp-digital/platform-admin-portal | |
attach() { | |
[ -n "${TMUX:-}" ] && | |
tmux switch-client -t '=platform-admin' || | |
tmux attach-session -t '=platform-admin' | |
} | |
if tmux has-session -t '=platform-admin' 2> /dev/null; then | |
attach | |
exit 0 | |
fi | |
tmux new-session -d -s platform-admin -n docker-compose | |
# tmux new-window -d -t '=platform-admin' -n docker-compose | |
tmux send-keys -t '=platform-admin:=docker-compose' 'make run' Enter | |
tmux new-window -d -t '=platform-admin' -n tests | |
tmux send-keys -t '=platform-admin:=tests' 'gst' Enter | |
attach |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment