removes AWS profile from RPROMPT and adds a function to make this available to themes

This commit is contained in:
Eugene Brodsky 2014-09-17 15:04:51 -04:00
commit 4065c605d2

View file

@ -14,9 +14,16 @@ function agp {
} }
function asp { function asp {
export AWS_DEFAULT_PROFILE=$1 export AWS_DEFAULT_PROFILE=$1
export RPROMPT="<aws:$AWS_DEFAULT_PROFILE>"
} }
# Makes AWS profile info available to shell prompt. Inspired by git_prompt_info()
function aws_prompt_info {
if [[ -n $(echo $AWS_DEFAULT_PROFILE) ]];
then
echo "$ZSH_THEME_AWS_PROFILE_PREFIX$AWS_DEFAULT_PROFILE$ZSH_THEME_AWS_PROFILE_SUFFIX"
fi
}
function aws_profiles { function aws_profiles {
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/')) reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
} }