1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-25 13:30:07 +00:00

Get active gcloud profile using list command (#1331)

`gcloud config configure describe` command does not have `--filter` option. To filter
the active profile using `--filter` it is necessary to use `gcloud config configure list`
command
This commit is contained in:
Éverton Arruda 2021-03-30 19:46:50 +02:00 committed by GitHub
parent af86b53047
commit 4d15cf977e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4498,7 +4498,7 @@ _p9k_gcloud_prefetch() {
P9K_GCLOUD_CONFIGURATION=$_p9k__ret P9K_GCLOUD_CONFIGURATION=$_p9k__ret
if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then if ! _p9k_cache_stat_get $0 ~/.config/gcloud/configurations/config_$P9K_GCLOUD_CONFIGURATION; then
local pair account project_id local pair account project_id
pair="$(gcloud config configurations describe $P9K_GCLOUD_CONFIGURATION \ pair="$(gcloud config configurations list $P9K_GCLOUD_CONFIGURATION \
--format=$'value[separator="\1"](properties.core.account,properties.core.project)' \ --format=$'value[separator="\1"](properties.core.account,properties.core.project)' \
--filter=is_active:true)" --filter=is_active:true)"
(( ! $? )) && IFS=$'\1' read account project_id <<<$pair (( ! $? )) && IFS=$'\1' read account project_id <<<$pair