mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-20 03:02:29 +01:00
removes AWS profile from RPROMPT and adds a function to make this available to themes
This commit is contained in:
parent
96e4e5dd03
commit
4065c605d2
1 changed files with 9 additions and 2 deletions
|
|
@ -14,9 +14,16 @@ function agp {
|
|||
}
|
||||
function asp {
|
||||
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 {
|
||||
reply=($(grep profile $AWS_HOME/config|sed -e 's/.*profile \([a-zA-Z0-9_-]*\).*/\1/'))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue