Fixed export option to work on Mac

pull/474/head
Eduardo Bellido Bellido 2015-05-11 00:01:36 +02:00
parent 7f8e2c2de7
commit ca52f5ce2f
1 changed files with 5 additions and 2 deletions

View File

@ -61,9 +61,12 @@ function __awskeys_show {
} }
function __awskeys_export { function __awskeys_export {
local p_keys="$(__awskeys_get $1)" local p_keys=( $(__awskeys_get $1 | tr -d " ") )
if [[ -n "${p_keys}" ]]; then if [[ -n "${p_keys}" ]]; then
eval $(echo "${p_keys}" | tr -d " " | sed -r -e "s/(.+=)(.+)/export \U\1\E\2/") for p_key in ${p_keys[@]}; do
local key="${p_key%=*}"
export "${key^^}=${p_key#*=}"
done
export AWS_DEFAULT_PROFILE="$1" export AWS_DEFAULT_PROFILE="$1"
else else
echo "Profile $1 not found in credentials file" echo "Profile $1 not found in credentials file"