feat(tmux): add tmuxinator session to monitor deployments
This commit is contained in:
@@ -4,6 +4,17 @@ function tat() {
|
||||
ALL_PROJECTS=$(tls)
|
||||
IS_VALID_PROJECT=$(echo $ALL_PROJECTS | grep -io "[[:<:]]$SAFE_INPUT\w*" | head -1)
|
||||
if [[ $IS_VALID_PROJECT != "" ]]; then
|
||||
if [[ "$IS_VALID_PROJECT" == "vrm-deploy" ]] && tmux has-session -t vrm-deploy 2>/dev/null; then
|
||||
current_session=$(tmux display-message -p '#S' 2>/dev/null)
|
||||
if [[ "$current_session" == "vrm-deploy" ]]; then
|
||||
tmux rename-session -t vrm-deploy vrm-deploy-old
|
||||
tmuxinator start vrm-deploy
|
||||
tmux kill-session -t vrm-deploy-old 2>/dev/null
|
||||
return 0
|
||||
else
|
||||
tmux kill-session -t vrm-deploy 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
tmuxinator start "$IS_VALID_PROJECT"
|
||||
return 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user