Added school default to slack status. Added more helpful error codes to master function

This commit is contained in:
Wryn Wagner 2020-03-25 12:44:36 -06:00
parent 05f4a6809c
commit 128756d056

View File

@ -19,22 +19,25 @@
# #
function rnt() { function rnt() {
ERROR_CODE=0;
case $1 in case $1 in
db | DB) db | DB)
RENT_DYNAMICS_CONNECT_TO_DATABASE "${@:2}"; RENT_DYNAMICS_CONNECT_TO_DATABASE "${@:2}" || ERROR_CODE=1;
;; ;;
refresh_db | REFRESH_DB) refresh_db | REFRESH_DB)
RENT_DYNAMICS_REFRESH_LOCAL_POSTGRES_DATABASES "${@:2}"; RENT_DYNAMICS_REFRESH_LOCAL_POSTGRES_DATABASES "${@:2}" || ERROR_CODE=2;
;; ;;
cleanup | CLEANUP) cleanup | CLEANUP)
RENT_DYNAMICS_GIT_PROJECT_CLEAN_UP "${@:2}"; RENT_DYNAMICS_GIT_PROJECT_CLEAN_UP "${@:2}" || ERROR_CODE=3;
;; ;;
status | slack-status) status | slack-status)
RENT_DYANAMICS_UPDATE_SLACK_STATUS "${@:2}"; RENT_DYANAMICS_UPDATE_SLACK_STATUS "${@:2}" || ERROR_CODE=4;
;; ;;
mail | MAIL | email | EMAIL) mail | MAIL | email | EMAIL)
# RENT_DYNAMICS_CONNECT_TO_EMAIL "${@:2}"; # RENT_DYNAMICS_CONNECT_TO_EMAIL "${@:2}";
echo "Email not currently supported :c" echo "Email not currently supported :c"
return 5;
;; ;;
*) *)
deactivate >/dev/null 2>/dev/null || deactivate_node >/dev/null 2>/dev/null; deactivate >/dev/null 2>/dev/null || deactivate_node >/dev/null 2>/dev/null;
@ -48,6 +51,7 @@ function rnt() {
[ -d "./code" ] && cd "./code"; [ -d "./code" ] && cd "./code";
} }
esac esac
return ERROR_CODE;
} }
_rnt () { # autocompletion _rnt () { # autocompletion
local state; local state;
@ -168,6 +172,9 @@ function RENT_DYANAMICS_UPDATE_SLACK_STATUS() {
off | not-working | no-money) off | not-working | no-money)
MESSAGE="not making money"; EMOJI=':sunglasses:'; MESSAGE="not making money"; EMOJI=':sunglasses:';
;; ;;
school )
MESSAGE="probably doing homework..."; EMOJI=':male-teacher:';
;;
clear | clear-status | no-status | please-turn-off-my-status-mr-slack-robot) clear | clear-status | no-status | please-turn-off-my-status-mr-slack-robot)
slack status clear >/dev/null 2>&1 slack status clear >/dev/null 2>&1
;; ;;
@ -189,6 +196,6 @@ function RENT_DYANAMICS_UPDATE_SLACK_STATUS() {
_RENT_DYANAMICS_UPDATE_SLACK_STATUS() { # autocompletion _RENT_DYANAMICS_UPDATE_SLACK_STATUS() { # autocompletion
compadd \ compadd \
boost-fire bike-ride monkas surprised plank meal turbo super meeting budget cheese foos belax \ boost-fire bike-ride monkas surprised plank meal turbo super meeting budget cheese foos belax \
panic not-working clear-status \ panic not-working school clear-status \
; ;
} }