Merge branch 'GCloud-Segment' of https://github.com/Jeklah/powerlevel10k into gcloud

This commit is contained in:
romkatv 2020-03-21 12:25:05 +01:00
commit 4c3c5487f9

View file

@ -4324,7 +4324,7 @@ prompt_gcloud() {
_p9k_read_word ~/.config/gcloud/active_config || return _p9k_read_word ~/.config/gcloud/active_config || return
if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$_p9k__ret; then if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$_p9k__ret; then
# TODO: Use `gcloud config configurations list` instead. # 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)" _p9k_cache_stat_set "$(gcloud config get-value account 2>/dev/null)" "$(gcloud projects describe `gcloud config get-value project 2>/dev/null` | grep name | cut -d ":" -f 2 2>/dev/null)"
fi fi
[[ -n $_p9k__cache_val[1] || -n $_p9k__cache_val[2] ]] || return [[ -n $_p9k__cache_val[1] || -n $_p9k__cache_val[2] ]] || return
P9K_GCLOUD_ACCOUNT=$_p9k__cache_val[1] P9K_GCLOUD_ACCOUNT=$_p9k__cache_val[1]