Add Docker Machine Env Node to Agnoster Theme
This commit is contained in:
parent
374688b313
commit
2e439a7d4e
@ -222,7 +222,25 @@ build_prompt() {
|
||||
prompt_git
|
||||
prompt_bzr
|
||||
prompt_hg
|
||||
prompt_docker_host
|
||||
# prompt_k8s_context
|
||||
prompt_end
|
||||
}
|
||||
|
||||
PROMPT='%{%f%b%k%}$(build_prompt) '
|
||||
|
||||
prompt_docker_host() {
|
||||
if [[ ! -z "$DOCKER_MACHINE_NAME" ]]; then
|
||||
prompt_segment red default "\xF0\x9F\x90\xB3: '$DOCKER_MACHINE_NAME'"
|
||||
elif [[ ! -z "$DOCKER_HOST" ]]; then
|
||||
prompt_segment red default "\xF0\x9F\x90\xB3: '$DOCKER_HOST'"
|
||||
fi
|
||||
}
|
||||
|
||||
# k8s context
|
||||
#prompt_k8s_context() {
|
||||
# K8S_CONTEXT=$(cat $KUBECONFIG | grep 'current-context:' | cut -d: -f2 | tr -d ' ')
|
||||
# if [[ -n "$K8S_CONTEXT" ]]; then
|
||||
# prompt_segment red default "%{$fg_bold[blue]%}\xE2\x8E\x88%{$fg_no_bold[white]%}: '$K8S_CONTEXT'"
|
||||
# fi
|
||||
#}
|
||||
|
Loading…
Reference in New Issue
Block a user