1
0
mirror of https://github.com/dcarrillo/prezto.git synced 2024-12-22 18:38:00 +00:00

[aws] Update AWS prompt when ACCESS_KEY is present

This commit is contained in:
Daniel Carrillo 2021-03-05 17:06:47 +01:00
parent f080e2075e
commit 667fba697e

View File

@ -14,14 +14,14 @@ unset aws_info
typeset -gA aws_info typeset -gA aws_info
if (( ${+AWS_SECRET_ACCESS_KEY} )); then if (( ${+AWS_SECRET_ACCESS_KEY} )); then
aws_prompt='ACCESS_KEY' aws_prompt="${AWS_PROFILE}  "
elif (( ${+AWS_PROFILE} )); then elif (( ${+AWS_PROFILE} )); then
aws_prompt=$AWS_PROFILE aws_prompt=$AWS_PROFILE
fi
if (( ${+AWS_DEFAULT_REGION} )) && [[ ${_aws_region} = "true" ]]; then 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=$(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" aws_region_prompt=" $AWS_REGION"
fi
fi fi
if (( ${+AWS_SECRET_ACCESS_KEY} )) || (( ${+AWS_DEFAULT_REGION} )); then if (( ${+AWS_SECRET_ACCESS_KEY} )) || (( ${+AWS_DEFAULT_REGION} )); then