diff options
author | romkatv <roman.perepelitsa@gmail.com> | 2020-01-31 12:26:56 +0300 |
---|---|---|
committer | romkatv <roman.perepelitsa@gmail.com> | 2020-01-31 12:26:56 +0300 |
commit | ecc0157d94b2faa505a3d8a9ccfc9d0205ee74bd (patch) | |
tree | 272d89188d68febbd9e2bf5bf8e76a0f657f0784 /internal/p10k.zsh | |
parent | c65260aaab46fee3d1eab033db258d0a366f03b4 (diff) | |
parent | ae12802bbeeb032e40248dafbc449b4a2c32a98b (diff) |
Merge branch 'Meroje-terraform-classes'
Diffstat (limited to 'internal/p10k.zsh')
-rw-r--r-- | internal/p10k.zsh | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 2b8ce324..5ba6159d 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4306,7 +4306,14 @@ function prompt_terraform() { [[ -r $f ]] && _p9k_read_file $f && ws=$_p9k_ret fi ws=${${ws##[[:space:]]#}%%[[:space:]]#} - [[ $ws == default ]] || _p9k_prompt_segment $0 $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws + local pat class + for pat class in "${_POWERLEVEL9K_TERRAFORM_CLASSES[@]}"; do + if [[ $ws == ${~pat} ]]; then + [[ -n $class ]] && state=_${(U)class} + break + fi + done + [[ $ws == default ]] || _p9k_prompt_segment "$0$state" $_p9k_color1 blue TERRAFORM_ICON 0 '' $ws } _p9k_prompt_terraform_init() { @@ -5887,6 +5894,7 @@ _p9k_init_params() { # POWERLEVEL9K_KUBECONTEXT_OTHER_BACKGROUND=yellow _p9k_declare -a POWERLEVEL9K_KUBECONTEXT_CLASSES -- _p9k_declare -a POWERLEVEL9K_AWS_CLASSES -- + _p9k_declare -a POWERLEVEL9K_TERRAFORM_CLASSES -- _p9k_declare -a POWERLEVEL9K_GOOGLE_APP_CRED_CLASSES -- 'service_account:*' SERVICE_ACCOUNT # Specifies the format of java version. # |