diff --git a/bash/.bashrc b/bash/.bashrc index e85b3d0..a969190 100644 --- a/bash/.bashrc +++ b/bash/.bashrc @@ -53,3 +53,14 @@ export BASH_SILENCE_DEPRECATION_WARNING=1 # AWS export KOPS_STATE_STORE=s3://lola-kops-cluster-state + +# bash prompt +if [ -f "/usr/local/opt/bash-git-prompt/share/gitprompt.sh" ]; then + __GIT_PROMPT_DIR="/usr/local/opt/bash-git-prompt/share" + source "/usr/local/opt/bash-git-prompt/share/gitprompt.sh" +else + parse_git_branch() { + git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' + } + export PS1="\[\e[32m\]\w \[\e[91m\]\$(parse_git_branch)\[\e[00m\]$ " +fi