Don't show k8s segment for empty "current context"

Fixes #122
This commit is contained in:
Justin Hileman 2018-01-10 06:38:55 -08:00
parent 914530cca4
commit 03ad58508a

View File

@ -504,8 +504,11 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
while read -l key val
if [ "$key" = 'current-context:' ]
set -l context (string trim -c '"\' ' -- $val)
[ -z "$context" ]; and return
__bobthefish_start_segment $__color_k8s
echo -ns $val ' '
echo -ns $context ' '
return
end
end < $file