diff options
Diffstat (limited to 'user')
-rw-r--r-- | user/zsh/zshrc | 43 |
1 files changed, 23 insertions, 20 deletions
diff --git a/user/zsh/zshrc b/user/zsh/zshrc index 6632490e..67eee653 100644 --- a/user/zsh/zshrc +++ b/user/zsh/zshrc @@ -81,31 +81,34 @@ else AGKOZAK_PROMPT_DIRTRIM=0 AGKOZAK_LEFT_PROMPT_ONLY=${+SSH_CLIENT} - check_kubectl_context () { - if [[ "$PWD" =~ satoshipay ]] - then - kubectl_context=$(kubectl config current-context) - kubectl_namespace=$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"${kubectl_context}\")].context.namespace}") - if [[ $kubectl_context =~ production ]] + if [[ -z $SSH_CLIENT ]] + then + check_kubectl_context () { + if [[ "$PWD" =~ satoshipay ]] then - kubectl_colour=red - kubectl_release=satoshipay-${kubectl_namespace} - else - kubectl_colour=yellow - if [[ -z $mr ]] + kubectl_context=$(kubectl config current-context) + kubectl_namespace=$(kubectl config view -o jsonpath="{.contexts[?(@.name==\"${kubectl_context}\")].context.namespace}") + if [[ $kubectl_context =~ production ]] then - kubectl_release=satoshipay-${kubectl_namespace}-staging + kubectl_colour=red + kubectl_release=satoshipay-${kubectl_namespace} else - kubectl_release=story-${mr}-${kubectl_namespace} + kubectl_colour=yellow + if [[ -z $mr ]] + then + kubectl_release=satoshipay-${kubectl_namespace}-staging + else + kubectl_release=story-${mr}-${kubectl_namespace} + fi fi - fi prompt_context="%F{$kubectl_colour}[${kubectl_context}:${kubectl_namespace}]%f" - else - prompt_context= - fi - } - precmd_functions+=(check_kubectl_context) - AGKOZAK_CUSTOM_RPROMPT='${prompt_context}%(3V.%F{${AGKOZAK_COLORS_BRANCH_STATUS}%3v%f.)' + else + prompt_context= + fi + } + precmd_functions+=(check_kubectl_context) + AGKOZAK_CUSTOM_RPROMPT='${prompt_context}%(3V.%F{${AGKOZAK_COLORS_BRANCH_STATUS}%3v%f.)' + fi fi export FZF_CTRL_T_COMMAND=' |