Support new gcloud CLI

The configuration name now needs to be passed to `gcloud config configurations list` using the `--configuration` argument.
This commit is contained in:
Tim Ysewyn 2021-04-04 16:30:58 +02:00 committed by GitHub
parent 8b2aab74d4
commit 3c746082fe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -4504,7 +4504,10 @@ _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 list $P9K_GCLOUD_CONFIGURATION \ pair="$(gcloud config configurations list --configuration $P9K_GCLOUD_CONFIGURATION \
--format=$'value[separator="\1"](properties.core.account,properties.core.project)' \
--filter=is_active:true 2>/dev/null)"
(( $? )) && 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