From 4f7efdcc8b288f61094ea384dfb0faddb46290cf Mon Sep 17 00:00:00 2001 From: romkatv Date: Fri, 14 Feb 2020 11:04:34 +0100 Subject: [PATCH] bug fix: detect gcloud config changes when using non-default configs --- internal/p10k.zsh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index c6d1304e..ccd75625 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -4106,9 +4106,10 @@ _p9k_prompt_azure_init() { } prompt_gcloud() { - # TODO: Use `gcloud config configurations list` instead. unset P9K_GCLOUD_PROJECT P9K_GCLOUD_ACCOUNT - if ! _p9k_cache_stat_get $0 ~/.config/gcloud/active_config ~/.config/gcloud/configurations/config_default; then + _p9k_read_word ~/.config/gcloud/active_config || return + if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$_p9k__ret; then + # TODO: Use `gcloud config configurations list` instead. _p9k_cache_stat_set "$(gcloud config get-value account 2>/dev/null)" "$(gcloud config get-value project 2>/dev/null)" fi [[ -n $_p9k__cache_val[1] || -n $_p9k__cache_val[2] ]] || return @@ -6960,7 +6961,7 @@ _p9k_must_init() { [[ $sig == $_p9k__param_sig ]] && return 1 _p9k_deinit fi - _p9k__param_pat=$'v45\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' + _p9k__param_pat=$'v46\1'${ZSH_VERSION}$'\1'${ZSH_PATCHLEVEL}$'\1' _p9k__param_pat+=$'${#parameters[(I)POWERLEVEL9K_*]}\1${(%):-%n%#}\1$GITSTATUS_LOG_LEVEL\1' _p9k__param_pat+=$'$GITSTATUS_ENABLE_LOGGING\1$GITSTATUS_DAEMON\1$GITSTATUS_NUM_THREADS\1' _p9k__param_pat+=$'$DEFAULT_USER\1${ZLE_RPROMPT_INDENT:-1}\1$P9K_SSH\1$__p9k_ksh_arrays'