feat(awsplugin): use acp command to switch profile without the right prompt

This commit is contained in:
Thomas Raimond 2017-01-27 12:21:24 +01:00
parent a7e30b26ba
commit 2053c8a9f6

View File

@ -15,17 +15,26 @@ function agp {
function asp {
local rprompt=${RPROMPT/<aws:$(agp)>/}
export AWS_DEFAULT_PROFILE=$1
export AWS_PROFILE=$1
switch_profile $1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>$rprompt"
}
function acp {
switch_profile $1
}
function switch_profile {
export AWS_DEFAULT=$1
export AWS_PROFILE=$1
}
function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
}
compctl -K aws_profiles asp
compctl -K aws_profiles acp
if _homebrew-installed && _awscli-homebrew-installed ; then
_aws_zsh_completer_path=$(brew --prefix awscli)/libexec/bin/aws_zsh_completer.sh