Move Kubernetes prompt color into a function

This commit is contained in:
Sergei Morozov 2020-08-13 18:15:12 -07:00
parent 626bd39b00
commit 864a50c42e
No known key found for this signature in database
GPG Key ID: 374EADAF543AE995
2 changed files with 6 additions and 2 deletions

View File

@ -0,0 +1,5 @@
function __bobthefish_prompt_k8s_color -S -d 'Determine Kubernetes prompt color based on the current context and namespace'
for i in $color_k8s
echo $i
end
end

View File

@ -645,11 +645,10 @@ function __bobthefish_prompt_k8s_context -S -d 'Show current Kubernetes context'
[ -n "$namespace" ] [ -n "$namespace" ]
and set segment $segment ':' $namespace and set segment $segment ':' $namespace
__bobthefish_start_segment $color_k8s __bobthefish_start_segment (__bobthefish_prompt_k8s_color $context $namespace)
echo -ns $segment ' ' echo -ns $segment ' '
end end
# ============================== # ==============================
# Cloud Tools # Cloud Tools
# ============================== # ==============================