summaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-07-30 08:14:51 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-07-30 08:14:51 +0300
commit2318bda2c31f687d2c9c0c6ee0a1dea07b4d13f4 (patch)
tree20d387ed0230173c403c88331139a0e3ef35ab06 /internal
parentda7d98633388d0fbf463460eeeaf387514119a2f (diff)
bug fixes: don't replace '_' with ' ' in gke clusters and clear the default of POWERLEVEL9K_KUBECONTEXT_SHORTEN
Diffstat (limited to 'internal')
-rwxr-xr-xinternal/p10k.zsh13
1 files changed, 6 insertions, 7 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index 306198b3..b76fa7ae 100755
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -2925,16 +2925,15 @@ prompt_kubecontext() {
case $shorten in
gke)
# gke_projectname_availability-zone_cluster-01 => cluster-01
- if [[ $cluster == gke_* ]]; then
- local parts=(${(s:_:)cluster})
- (( $#parts > 3 )) && text=$parts[4,-1]
+ if [[ $cluster == (#b)gke_[^_]#_[^_]#_(?*) ]]; then
+ text=$match[1]
break
fi
;;
eks)
- # arn:aws:eks:us-east-1:XXXXXXXXXXXX:cluster/eks-infra
- if [[ $cluster == (#b)arn:aws:eks:[[:alnum:]-]##:[[:digit:]]##:cluster/(*) ]]; then
- [[ -n $match[1] ]] && text=$match[1]
+ # arn:aws:eks:us-east-1:123456789012:cluster/eks-infra
+ if [[ $cluster == (#b)arn:aws:eks:[[:alnum:]-]##:[[:digit:]]##:cluster/(?*) ]]; then
+ text=$match[1]
break
fi
esac
@@ -3716,7 +3715,7 @@ _p9k_init_params() {
_p9k_declare -e POWERLEVEL9K_NODEENV_LEFT_DELIMITER "["
_p9k_declare -e POWERLEVEL9K_NODEENV_RIGHT_DELIMITER "]"
_p9k_declare -b POWERLEVEL9K_KUBECONTEXT_SHOW_DEFAULT_NAMESPACE 1
- _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_SHORTEN -- gke eks
+ _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_SHORTEN --
# Defines context classes for the purpose of applying different styling to different contexts.
#
# POWERLEVEL9K_KUBECONTEXT_CLASSES must be an array with even number of elements. The first