f01eea76da194fef6005f53a281b6f5a998db126

Author
ZYX <yuxz@amazon.com>
Committer
GitHub <noreply@github.com>
Date

Message

fix(aws): use the correct variable to assert region is defined (#11691)

Diff

 1diff --git a/plugins/aws/aws.plugin.zsh b/plugins/aws/aws.plugin.zsh
 2index b2415b737303dedb41d982b3e3ab3e5f47f21363..c946515be549836dc43b13182095382f7183abf0 100644
 3--- a/plugins/aws/aws.plugin.zsh
 4+++ b/plugins/aws/aws.plugin.zsh
 5@@ -224,12 +224,12 @@ function aws_prompt_info() {
 6   local _aws_to_show
 7   local region="${AWS_REGION:-${AWS_DEFAULT_REGION:-$AWS_PROFILE_REGION}}"
 8 
 9-  if [[ -n $AWS_PROFILE ]];then
10+  if [[ -n "$AWS_PROFILE" ]];then
11     _aws_to_show+="${ZSH_THEME_AWS_PROFILE_PREFIX="<aws:"}${AWS_PROFILE}${ZSH_THEME_AWS_PROFILE_SUFFIX=">"}"
12   fi
13 
14-  if [[ -n $AWS_REGION ]]; then
15-    [[ -n $AWS_PROFILE ]] && _aws_to_show+="${ZSH_THEME_AWS_DIVIDER=" "}"
16+  if [[ -n "$region" ]]; then
17+    [[ -n "$_aws_to_show" ]] && _aws_to_show+="${ZSH_THEME_AWS_DIVIDER=" "}"
18     _aws_to_show+="${ZSH_THEME_AWS_REGION_PREFIX="<region:"}${region}${ZSH_THEME_AWS_REGION_SUFFIX=">"}"
19   fi
20