Last active
September 8, 2019 00:28
-
-
Save gbaptista/9fe2c11c5f2b155238d9d5f44eafb7b6 to your computer and use it in GitHub Desktop.
This file contains 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
LIGHTBLUE="\[\033[1;34m\]" | |
LIGHTRED="\[\033[1;31m\]" | |
WHITE="\[\033[1;37m\]" | |
ORANGE="\[\033[38;5;172m\]" | |
NO_COLOR="\[\033[0m\]" | |
function k8sNamespace() { | |
printf $(kubectl config view -o=jsonpath='{.contexts[0].context.namespace}') | |
} | |
function parse_git_branch () { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' | |
} | |
PROMPT_DIRTRIM=2 | |
PS1="$LIGHTBLUE$(whoami)$WHITE @ $NO_COLOR\w $LIGHTRED[\$(k8sNamespace)]$ORANGE\$(parse_git_branch)$NO_COLOR \$ " |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment