Last active
September 22, 2018 19:20
-
-
Save bhaak/c87c43c752c4db87f9ab94bc2fa7d90c to your computer and use it in GitHub Desktop.
This file contains 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 | |
SOCKET=/tmp/tmux-1001/default | |
WINDOW=`tmux -S $SOCKET list-panes -F '#I'` | |
WINDOW=69 | |
function black_window { | |
tmux -S $SOCKET rename-window -t:$WINDOW ' ' | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-fg black | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-bg black | |
} | |
function control_c { | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-fg default | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-bg default | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-current-fg default | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-current-bg red | |
echo "exit" | |
exit 1 | |
} | |
trap control_c SIGINT | |
fswatch -1 -m poll_monitor lib spec | |
black_window | |
#rspec -t test spec/ | |
rspec spec/ | |
if [ $? -eq 0 ]; then | |
tmux -S $SOCKET rename-window -t:$WINDOW ' ✓ ' | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-fg black | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-bg green | |
else | |
tmux -S $SOCKET rename-window -t:$WINDOW 'XXXXXX' | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-fg white | |
tmux -S $SOCKET set-window-option -t:$WINDOW window-status-bg red | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment