Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stuyam/7a705e469e2318e1c048b64b22d5276c to your computer and use it in GitHub Desktop.
Save stuyam/7a705e469e2318e1c048b64b22d5276c to your computer and use it in GitHub Desktop.
When you run heroku command on a staging server it will be yellow, else it will be red.
SELECTED_TAB=$(osascript -e "tell application \"Terminal\" to get selected tab of window 1")
ALL_ARGS="'$*'"
if [[ $ALL_ARGS =~ stg|staging ]];
then
echo "matches"
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {65280, 49408, 1792}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {0, 0, 0}"
else
echo "doesn't match"
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {56320, 13568, 17664}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {65280, 65280, 65280}"
fi
/usr/local/bin/heroku $@;
osascript -e "tell application \"Terminal\" to set background color of $SELECTED_TAB to {0, 0, 0}";
osascript -e "tell application \"Terminal\" to set normal text color of $SELECTED_TAB to {0, 63993, 0}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment