mirror of
https://github.com/akelge/zsh
synced 2025-07-03 05:05:28 +00:00
Changes to aswprofile, for region
This commit is contained in:
@ -14,7 +14,8 @@ if [ $profile ]; then # We got a profile pattern, look for a match
|
||||
echo "Activating profile $match"
|
||||
export AWS_DEFAULT_PROFILE=$match
|
||||
export AWS_PROFILE=$match
|
||||
export AWS_EB_PROFILE=$match
|
||||
export AWS_DEFAULT_REGION=$(grep -A1 $match ~/.aws/config|grep region|cut -d" " -f3)
|
||||
export AWS_REGION=${AWS_DEFAULT_REGION}
|
||||
return
|
||||
else
|
||||
echo "No match for $profile"
|
||||
@ -22,7 +23,7 @@ if [ $profile ]; then # We got a profile pattern, look for a match
|
||||
fi
|
||||
|
||||
elif [ $AWS_PROFILE ]; then # no profile passed, clean up current one, logout
|
||||
unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_EB_PROFILE
|
||||
unset AWS_DEFAULT_PROFILE AWS_PROFILE AWS_DEFAULT_REGION AWS_REGION
|
||||
echo profile cleared.
|
||||
return
|
||||
fi
|
||||
|
Binary file not shown.
Reference in New Issue
Block a user