From 6b0f8a7054362c22e1e9a4194d26c4ccb5ac173b Mon Sep 17 00:00:00 2001 From: Pierre Rossi Date: Wed, 18 Aug 2021 10:38:20 +0200 Subject: [PATCH] Add support for AWS_REGION with fallback to AWS_DEFAULT_REGION Mapping the fallback behaviour of the aws CLI. Other tools and runtimes seem to behave differently with these variables. --- internal/p10k.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/p10k.zsh b/internal/p10k.zsh index 80b5d5b1..f4c032d7 100644 --- a/internal/p10k.zsh +++ b/internal/p10k.zsh @@ -1168,8 +1168,8 @@ prompt_aws() { fi done - if [[ -n $AWS_DEFAULT_REGION ]]; then - typeset -g P9K_AWS_REGION=$AWS_DEFAULT_REGION + if [[ -n ${AWS_REGION:-AWS_DEFAULT_REGION} ]]; then + typeset -g P9K_AWS_REGION=${AWS_REGION:-AWS_DEFAULT_REGION} else local cfg=${AWS_CONFIG_FILE:-~/.aws/config} if ! _p9k_cache_stat_get $0 $cfg; then