@@ -11,6 +11,34 @@ COLOR_LIGHT_RED=$(tput sgr0 && tput bold && tput setaf 1)
1111COLOR_LIGHT_CYAN=$( tput sgr0 && tput bold && tput setaf 6)
1212COLOR_RESET=$( tput sgr0)
1313
14+ pathadd () {
15+ newelement=${1%/ }
16+ if [ -d " $1 " ] && ! echo " $PATH " | grep -E -q " (^|:)$newelement ($|:)" ; then
17+ if [ " $2 " = " after" ] ; then
18+ PATH=" $PATH :$newelement "
19+ else
20+ PATH=" $newelement :$PATH "
21+ fi
22+ fi
23+ }
24+
25+ pathrm () {
26+ PATH=" $( echo $PATH | sed -e " s;\(^\|:\)${1%/ } \(:\|\$ \);\1\2;g" -e ' s;^:\|:$;;g' -e ' s;::;:;g' ) "
27+ }
28+
29+
30+ # Configuration for the command line tool "hh" (history searcher to replace ctrl-r, brew install hh)
31+ export HH_CONFIG=hicolor,rawhistory,favorites # get more colors
32+ shopt -s histappend # append new history items to .bash_history
33+ # export HISTSIZE=${HISTFILESIZE} # increase history size (default is 500)
34+ # export PROMPT_COMMAND="history -a; history -n; ${PROMPT_COMMAND}" # mem/file sync
35+ # if this is interactive shell, then bind hh to Ctrl-r (for Vi mode check doc)
36+ # if [[ $- =~ .*i.* ]]; then bind '"\C-r": "\C-a hh -- \C-j"'; fi
37+ # if this is interactive shell, then bind 'kill last command' to Ctrl-x k
38+ # if [[ $- =~ .*i.* ]]; then bind '"\C-xk": "\C-a hh -k \C-j"'; fi
39+
40+ # AWS_ENVIRONMENT_BETA=true
41+
1442# From awscli tools "Add the following to ~/.bashrc to enable bash completion:"
1543complete -C aws_completer aws
1644
@@ -226,9 +254,6 @@ function what-is-listening-on-port() {
226254 lsof -n -i4TCP:$1 | grep LISTEN
227255}
228256
229- # required for dojo install of api (canvas dependency)
230- # PKG_CONFIG_PATH=$PKG_CONFIG_PATH:/opt/X11/lib/pkgconfig
231-
232257# Don't wait for job termination notification
233258set -o notify
234259
@@ -872,19 +897,20 @@ function gr_banana() {
872897
873898PS1=" \n\[$COLOR_YELLOW \]\u\[\$ (error_test)\]@\[$COLOR_GREEN \]\w\$ (${dvcs_function} )\[$COLOR_RESET \] \$ "
874899
875- # ## Added by the Heroku Toolbelt
876- # export PATH="/usr/local/heroku/bin:$PATH"
877-
878900# Grand rounds stuff
879901export GR_HOME=${HOME} /dev
880902export GR_USERNAME=andrew.ray
881903
882904if [ -d " $GR_HOME " ]; then
905+
906+ if [ -n " $LOGIN_WAIT " ]; then
907+ echo " waiting ${LOGIN_WAIT} "
908+ fi
883909 for file in ${GR_HOME} /engineering/bash/* .sh; do
884910 source $file ;
885911 done
886912
887- export PATH= ${GR_HOME} /engineering/bin: ${PATH}
913+ pathadd " ${GR_HOME} /engineering/bin"
888914
889915 # default to aws env
890916 aws-environment development
896922alias vscode=code
897923
898924# Android SDK
899- export PATH=" ${HOME} /Library/Android/sdk/tools:${HOME} /Library/Android/sdk/platform-tools:${PATH} "
925+ pathadd " ${HOME} /Library/Android/sdk/tools:${HOME} /Library/Android/sdk/platform-tools"
926+ # export PATH="${HOME}/Library/Android/sdk/tools:${HOME}/Library/Android/sdk/platform-tools:${PATH}"
900927
901928# Banyan stuff
902929alias bstart=" pg_ctl start -D /usr/local/var/postgres-banyan -l /usr/local/var/postgres-banyan/server.log"
@@ -920,8 +947,10 @@ if [ -f /Users/andrewray/google-cloud-sdk/completion.bash.inc ]; then
920947 source ' /Users/andrewray/google-cloud-sdk/completion.bash.inc'
921948fi
922949
950+ # My C quick branch switcher script
923951if [[ -d " ${HOME} /c" ]]; then
924- export PATH=" ${HOME} /c:${PATH} "
952+ # export PATH="${HOME}/c:${PATH}"
953+ pathadd " ${HOME} /c"
925954 source ~ /c/c_recent_branches_completer
926955fi
927956
@@ -937,6 +966,9 @@ if [[ $(command -v pyenv) ]]; then
937966 fi
938967fi
939968
969+ export IPSEC_SECRETS_FILE=/etc/ipsec.secrets
970+ export KEY_SUFFIX=grandrounds.com
971+
940972# GR
941973function releaseCommits() {
942974 git fetch --all
@@ -1044,3 +1076,20 @@ function switch_dialog {
10441076 esac
10451077}
10461078
1079+ function docker_tag_exists() {
1080+ path=" https://index.docker.io/v1/repositories/$1 /tags/$2 "
1081+ if curl --silent -f -lSL " $path " 2> /dev/null; then
1082+ echo " ${COLOR_GREEN} Found $1 $2 at${COLOR_RESET} "
1083+ echo " ${COLOR_LIGHT_GREEN}${path}${COLOR_RESET} "
1084+ else
1085+ echo " ${COLOR_RED} Tag $1 $2 not found, checked path:${COLOR_RESET} "
1086+ echo " ${COLOR_LIGHT_RED}${path}${COLOR_RESET} "
1087+ fi
1088+ }
1089+
1090+ TRACKER_FLOW_PATH=" $GR_HOME /tracker-flow"
1091+ if [ -d " $TRACKER_FLOW_PATH " ]; then
1092+ pathadd " $TRACKER_FLOW_PATH "
1093+ . " $TRACKER_FLOW_PATH /tracker_completion.bash"
1094+ fi
1095+
0 commit comments