summaryrefslogtreecommitdiff
path: root/themes/agnoster.zsh-theme
diff options
context:
space:
mode:
Diffstat (limited to 'themes/agnoster.zsh-theme')
-rw-r--r--themes/agnoster.zsh-theme17
1 files changed, 15 insertions, 2 deletions
diff --git a/themes/agnoster.zsh-theme b/themes/agnoster.zsh-theme
index 23c606de2..05a50cd2b 100644
--- a/themes/agnoster.zsh-theme
+++ b/themes/agnoster.zsh-theme
@@ -152,7 +152,6 @@ prompt_bzr() {
if [[ $status_all -gt 0 ]] ; then
prompt_segment yellow black
echo -n "bzr@"$revision
-
else
prompt_segment green black
echo -n "bzr@"$revision
@@ -230,7 +229,20 @@ prompt_cabal_sandbox() {
if [ -f cabal.sandbox.config ]; then
prompt_segment cyan black "sandbox"
fi
- fi
+ fi
+}
+
+#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() {
+ [[ -z "$AWS_PROFILE" ]] && return
+ case "$AWS_PROFILE" in
+ *-prod|*production*) prompt_segment red yellow "AWS: $AWS_PROFILE" ;;
+ *) prompt_segment green black "AWS: $AWS_PROFILE" ;;
+ esac
}
## Main prompt
@@ -238,6 +250,7 @@ build_prompt() {
RETVAL=$?
prompt_status
prompt_virtualenv
+ prompt_aws
prompt_context
prompt_dir
prompt_git