feat(aws-plugin): added aws profile in prompt

This commit is contained in:
Thomas Raimond
2017-01-27 12:15:23 +01:00
parent d3b6c499e1
commit f707299b1a

View File

@@ -27,6 +27,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
ruby ruby
virtualenv virtualenv
nvm nvm
aws
go go
git git
hg hg
@@ -103,6 +104,20 @@ if [ ! -n "${BULLETTRAIN_NVM_PREFIX+1}" ]; then
BULLETTRAIN_NVM_PREFIX="⬡ " BULLETTRAIN_NVM_PREFIX="⬡ "
fi fi
# AWS
if [ ! -n "${BULLETTRAIN_AWS_SHOW+1}" ]; then
BULLETTRAIN_AWS_SHOW=true
fi
if [ ! -n "${BULLETTRAIN_AWS_BG+1}" ]; then
BULLETTRAIN_AWS_BG=red
fi
if [ ! -n "${BULLETTRAIN_AWS_FG+1}" ]; then
BULLETTRAIN_AWS_FG=white
fi
if [ ! -n "${BULLETTRAIN_AWS_PREFIX+1}" ]; then
BULLETTRAIN_AWS_PREFIX="☁️ "
fi
# RUBY # RUBY
if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then
BULLETTRAIN_RUBY_BG=magenta BULLETTRAIN_RUBY_BG=magenta
@@ -494,6 +509,19 @@ prompt_nvm() {
prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$nvm_prompt prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$nvm_prompt
} }
# AWS Profile
prompt_aws() {
if [[ $BULLETTRAIN_AWS_SHOW == false ]]; then
return
fi
local aws_profile="$AWS_DEFAULT_PROFILE"
if [[ -n "$aws_profile" ]]; then
prompt_segment $BULLETTRAIN_AWS_BG $BULLETTRAIN_AWS_FG $BULLETTRAIN_AWS_PREFIX$aws_profile
fi
}
prompt_time() { prompt_time() {
if [[ $BULLETTRAIN_TIME_12HR == true ]]; then if [[ $BULLETTRAIN_TIME_12HR == true ]]; then
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r} prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}