mirror of https://github.com/akelge/zsh
Changes to aswprofile, for region
This commit is contained in:
parent
48634fc7a8
commit
8b02f06f98
|
@ -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.
Loading…
Reference in New Issue