aboutsummaryrefslogtreecommitdiff
path: root/internal
diff options
context:
space:
mode:
authorJeklah <arthurbowers@gmail.com>2020-03-16 15:37:43 +0300
committerGitHub <noreply@github.com>2020-03-16 15:37:43 +0300
commitba26a1a076b1c40ff8aa7ae363d75f3f33c9cec8 (patch)
tree62ea25a5a5d27a09476172106ed5091fe71cd947 /internal
parent48a61471a7f257787332714b2f6a16e9ec04174d (diff)
GCloud Segment shows proj name not proj ID.
Logic behind change: gcloud project IDs are semi randomly generated and can not be changed by the user. The project name can be changed and is much easier on the eyes, and easier for the user the identify the project, as it will be what they typed in when naming the project, as opposed to the ID which they won't have typed in.
Diffstat (limited to 'internal')
-rw-r--r--internal/p10k.zsh2
1 files changed, 1 insertions, 1 deletions
diff --git a/internal/p10k.zsh b/internal/p10k.zsh
index f0e4d089..3e54608a 100644
--- a/internal/p10k.zsh
+++ b/internal/p10k.zsh
@@ -4332,7 +4332,7 @@ prompt_gcloud() {
_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)"
+ _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
[[ -n $_p9k__cache_val[1] || -n $_p9k__cache_val[2] ]] || return
P9K_GCLOUD_ACCOUNT=$_p9k__cache_val[1]