Merge pull request #199 from ThamosIO/feat/aws-profile-in-prompt

feat(aws-plugin): added aws profile in prompt
This commit is contained in:
Viktor (Icon) VAD
2017-04-26 11:58:03 +01:00
committed by GitHub
2 changed files with 32 additions and 0 deletions

View File

@@ -27,6 +27,7 @@ if [ ! -n "${BULLETTRAIN_PROMPT_ORDER+1}" ]; then
ruby
virtualenv
nvm
aws
go
elixir
git
@@ -104,6 +105,17 @@ if [ ! -n "${BULLETTRAIN_NVM_PREFIX+1}" ]; then
BULLETTRAIN_NVM_PREFIX="⬡ "
fi
# AWS
if [ ! -n "${BULLETTRAIN_AWS_BG+1}" ]; then
BULLETTRAIN_AWS_BG=yellow
fi
if [ ! -n "${BULLETTRAIN_AWS_FG+1}" ]; then
BULLETTRAIN_AWS_FG=black
fi
if [ ! -n "${BULLETTRAIN_AWS_PREFIX+1}" ]; then
BULLETTRAIN_AWS_PREFIX="☁️"
fi
# RUBY
if [ ! -n "${BULLETTRAIN_RUBY_BG+1}" ]; then
BULLETTRAIN_RUBY_BG=red
@@ -517,6 +529,15 @@ prompt_nvm() {
prompt_segment $BULLETTRAIN_NVM_BG $BULLETTRAIN_NVM_FG $BULLETTRAIN_NVM_PREFIX$nvm_prompt
}
#AWS Profile
prompt_aws() {
local spaces=" "
if [[ -n "$AWS_PROFILE" ]]; then
prompt_segment $BULLETTRAIN_AWS_BG $BULLETTRAIN_AWS_FG $BULLETTRAIN_AWS_PREFIX$spaces$AWS_PROFILE
fi
}
prompt_time() {
if [[ $BULLETTRAIN_TIME_12HR == true ]]; then
prompt_segment $BULLETTRAIN_TIME_BG $BULLETTRAIN_TIME_FG %D{%r}