add AWS_PROFILE to prompt
This commit is contained in:
parent
37c2d0ddd7
commit
e17ec755ee
@ -212,11 +212,29 @@ prompt_status() {
|
|||||||
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
|
[[ -n "$symbols" ]] && prompt_segment black default "$symbols"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#AWS Profile:
|
||||||
|
# - display current AWS_PROFILE name
|
||||||
|
# - displays yellow on red if profile name contains 'production' or
|
||||||
|
# ends in '-prod'
|
||||||
|
# - displays black on green otherwise
|
||||||
|
prompt_aws_profile() {
|
||||||
|
local aws_profile="$AWS_PROFILE"
|
||||||
|
if [[ -n $aws_profile ]]; then
|
||||||
|
if [[ $aws_profile == *"-prod" || $aws_profile == *"production"* ]]; then
|
||||||
|
prompt_segment red yellow "$aws_profile"
|
||||||
|
else
|
||||||
|
prompt_segment green black "$aws_profile"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
## Main prompt
|
## Main prompt
|
||||||
build_prompt() {
|
build_prompt() {
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
prompt_status
|
prompt_status
|
||||||
prompt_virtualenv
|
prompt_virtualenv
|
||||||
|
prompt_aws_profile
|
||||||
prompt_context
|
prompt_context
|
||||||
prompt_dir
|
prompt_dir
|
||||||
prompt_git
|
prompt_git
|
||||||
|
Loading…
Reference in New Issue
Block a user