Created
April 13, 2018 01:10
-
-
Save radditude/c4a7c6f6289a1d9e71f6d502b4c5f8ca to your computer and use it in GitHub Desktop.
Tmux start-up script for multiple server processes
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/zsh | |
# $PROJECTDIR is set in .zshrc/bash_profile | |
FIRSTDIR="$PROJECTDIR/first" | |
SECONDDIR="$PROJECTDIR/second" | |
# starts a tmux session using iTerm's tmux mode | |
# opens a new tab for each service and ensures that the name won't get overridden | |
# runs the servers/queues/processes for each service | |
# sends the command but doesn't run it for services I don't need all the time | |
tmux -CC \ | |
set-option -g allow-rename off \; \ | |
new-session -n "FIRST" \; \ | |
send-keys "cd $FIRSTDIR && start the server" C-m \; \ | |
split-window -h \; \ | |
send-keys "cd $FIRSTDIR && start the queue server" \; \ | |
split-window -v \; \ | |
send-keys "cd $FIRSTDIR && start the helper service" C-m \; \ | |
new-window -n "SECOND" \; \ | |
send-keys "cd $SECONDDIR && start the server" C-m \; \ | |
split-window -h \; \ | |
send-keys "cd $SECONDDIR && start the queue server" C-m \; \ | |
split-window -v \; \ | |
send-keys "cd $SECONDDIR && start webpack/the asset service" \; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment