Created
October 4, 2013 02:10
-
-
Save levicook/6819972 to your computer and use it in GitHub Desktop.
make tmux start my 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
#!/bin/bash | |
set -e # exit if anything goes wrong from here forward | |
bundle | |
# are we already in session? | |
if tmux ls | grep -q spyrojs; then # just attach to the existing session | |
tmux attach-session -d -t spyrojs | |
else # create a new session and start the world | |
tmux new-session -d -s spyrojs -n vim | |
tmux send-keys -t spyrojs:1 "vim +:NERDTree" C-m | |
tmux new-window -t spyrojs:2 -n console | |
tmux send-keys -t spyrojs:2 "bundle exec rake init" C-m | |
tmux new-window -t spyrojs:3 -n server | |
tmux send-keys -t spyrojs:3 "echo 'Listening on http://localhost:1080'; go run server/main.go" C-m | |
tmux split-window -t spyrojs:3 -v | |
tmux send-keys -t spyrojs:3 "bundle exec guard --no-interactions --group=livereload" C-m | |
tmux select-window -t spyrojs:1 | |
tmux split-window -t spyrojs:1 -v | |
tmux send-keys -t spyrojs:1 "bundle exec guard --no-interactions --group=build" C-m | |
tmux attach-session -t spyrojs | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment