-
-
Save bjjb/9d271e7252c26677f83a to your computer and use it in GitHub Desktop.
tmux script for a web-app project
This file contains hidden or 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
| #!/usr/bin/env sh | |
| name="My Cool Web App Project" | |
| serve="npm start" | |
| watch="node_modules/.bin/cake watch" | |
| serve="npm start" | |
| tmux has-session -t "$name" | |
| if [ $? != 0 ] | |
| then | |
| tmux new-session -d -name "$name" -n edit | |
| tmux send-keys -t "$name":edit "vim ." C-m | |
| tmux split-window -t "$name":edit -d -l 2 | |
| tmux send-keys -t "$name":edit.2 "$watch" C-m | |
| tmux new-window -t "$name" -d -n server | |
| tmux send-keys -t "$name":server ""$serve"" C-m | |
| fi | |
| tmux attach-session -t "$name" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment