From cf880397f566542798b28bfc9782d3171b74a8ab Mon Sep 17 00:00:00 2001 From: Alex Mikhalev Date: Sat, 25 Aug 2018 12:22:18 -0600 Subject: [PATCH] Added a script to run in tmux --- start-tmux.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 start-tmux.sh diff --git a/start-tmux.sh b/start-tmux.sh new file mode 100755 index 0000000..34b487b --- /dev/null +++ b/start-tmux.sh @@ -0,0 +1,17 @@ +#!/usr/bin/env bash + +DIR=$(dirname $0) +SESSION_NAME=sprinklers3 + +tmux has-session -t ${SESSION_NAME} + +if [ $? != 0 ]; then + tmux new-session -s ${SESSION_NAME} -n server -d + tmux send-keys -t ${SESSION_NAME} "cd ${DIR}" C-m + tmux send-keys -t ${SESSION_NAME} "yarn start:watch" C-m + tmux new-window -t ${SESSION_NAME} -n client + tmux send-keys -t "${SESSION_NAME}:client" "yarn start:dev-server" C-m +fi + +tmux attach -t ${SESSION_NAME} +