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.
This commit is contained in:
Pierre Rossi 2021-08-18 10:38:20 +02:00
parent 25e5f5985f
commit 6b0f8a7054
1 changed files with 2 additions and 2 deletions

View File

@ -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