From 667fba697e06c0025b045d576d8dbafb3658c0a4 Mon Sep 17 00:00:00 2001 From: Daniel Carrillo Date: Fri, 5 Mar 2021 17:06:47 +0100 Subject: [PATCH] [aws] Update AWS prompt when ACCESS_KEY is present --- modules/aws/functions/aws-info | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/aws/functions/aws-info b/modules/aws/functions/aws-info index c021964..cd5de00 100644 --- a/modules/aws/functions/aws-info +++ b/modules/aws/functions/aws-info @@ -14,14 +14,14 @@ unset aws_info typeset -gA aws_info if (( ${+AWS_SECRET_ACCESS_KEY} )); then - aws_prompt='ACCESS_KEY' + aws_prompt="${AWS_PROFILE}  " elif (( ${+AWS_PROFILE} )); then aws_prompt=$AWS_PROFILE +fi - if (( ${+AWS_DEFAULT_REGION} )) && [[ ${_aws_region} = "true" ]]; then - AWS_REGION=$(cut -d "-" -f 1 <<<$AWS_DEFAULT_REGION | cut -b 1)$(cut -d "-" -f 2 <<<$AWS_DEFAULT_REGION | cut -b 1)$(cut -d "-" -f 3 <<<$AWS_DEFAULT_REGION | cut -b 1) - aws_region_prompt=" $AWS_REGION" - fi +if (( ${+AWS_DEFAULT_REGION} )) && [[ ${_aws_region} = "true" ]]; then + AWS_REGION=$(cut -d "-" -f 1 <<<$AWS_DEFAULT_REGION | cut -b 1)$(cut -d "-" -f 2 <<<$AWS_DEFAULT_REGION | cut -b 1)$(cut -d "-" -f 3 <<<$AWS_DEFAULT_REGION | cut -b 1) + aws_region_prompt=" $AWS_REGION" fi if (( ${+AWS_SECRET_ACCESS_KEY} )) || (( ${+AWS_DEFAULT_REGION} )); then