summaryrefslogtreecommitdiff
path: root/themes/agnoster.zsh-theme
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2019-09-11 18:19:51 -0600
committerTuowen Zhao <ztuowen@gmail.com>2019-09-11 18:19:51 -0600
commitd676c1553254309beca5bb9a8edb43fbe09a7169 (patch)
treed0bb04b6487e6fedbb2b2370a894fccd19d4c567 /themes/agnoster.zsh-theme
parentfb141c2257f648cd29b64cbd3f2ca9123f6e427f (diff)
parentddd359dd668f448856438304bedfe952d1749efd (diff)
downloadzsh-d676c1553254309beca5bb9a8edb43fbe09a7169.tar.gz
zsh-d676c1553254309beca5bb9a8edb43fbe09a7169.tar.bz2
zsh-d676c1553254309beca5bb9a8edb43fbe09a7169.zip
Merge remote-tracking branch 'orig/master'
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