Last active
February 22, 2019 20:08
-
-
Save jethroo/6bdd1718a6b3883e0422a2e3f40f96f8 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| COLUMNS=250 | |
| NORMAL="\[\033[00m\]" | |
| YELLOW="\[\033[33m\]" | |
| RED="\[\033[31m\]" | |
| function parse_git_dirty { | |
| [[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "β‘οΈ" | |
| } | |
| # show git branch | |
| parse_git_branch() { | |
| git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/" | |
| } | |
| kube_ps1_color() { | |
| local context=$(kubectl config current-context); | |
| if [ -n "$context" ]; | |
| then | |
| case "$context" in | |
| *production*) echo -e "\033[31m" ;; | |
| *staging*) echo -e "\033[33m" ;; | |
| *third-being*) echo -e "\033[00m" ;; | |
| esac | |
| fi | |
| } | |
| kube_ps1_name() { | |
| local context=$(kubectl config current-context); | |
| if [ -n "$context" ]; | |
| then | |
| case "$context" in | |
| *production*) echo "π¦ PRO π" ;; | |
| *staging*) echo "π STA π" ;; | |
| *third-being*) echo "π¦ DEV π" ;; | |
| esac | |
| fi | |
| } | |
| export PS1="\[\$(kube_ps1_color)\]\$(kube_ps1_name) ${NORMAL}\h${YELLOW} \w ${RED}\$(parse_git_branch)${NORMAL}\$${NORMAL} " | |
| ssh-add ~/.ssh/id_rsa | |
| # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. | |
| export PATH="$PATH:$HOME/Workspace/liqid-infrastructure/bin" | |
| stty echo | |
| # Add RVM to PATH for scripting. Make sure this is the last PATH variable change. | |
| export PATH="$PATH:$HOME/.rvm/bin" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment