Skip to content

Instantly share code, notes, and snippets.

@levicook
Created October 4, 2013 02:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save levicook/6819972 to your computer and use it in GitHub Desktop.
Save levicook/6819972 to your computer and use it in GitHub Desktop.
make tmux start my project
#!/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