aboutsummaryrefslogtreecommitdiff
path: root/powerlevel9k.zsh-theme
diff options
context:
space:
mode:
authorromkatv <roman.perepelitsa@gmail.com>2019-05-22 15:09:02 +0300
committerromkatv <roman.perepelitsa@gmail.com>2019-05-22 15:09:02 +0300
commitdc6fdf52b7a17935b70c5cba5a116b7277029dd3 (patch)
treeac5f20b93f3dffff9b000a6c3c0609a6892b8e82 /powerlevel9k.zsh-theme
parent5b703c0db04c2eda8793da26d2d709ba38619adc (diff)
speed up aws_eb_env prompt
Diffstat (limited to 'powerlevel9k.zsh-theme')
-rwxr-xr-xpowerlevel9k.zsh-theme8
1 files changed, 3 insertions, 5 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 9ec8ad65..2f7eee3b 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -377,11 +377,9 @@ prompt_aws() {
################################################################
# Current Elastic Beanstalk environment
prompt_aws_eb_env() {
- # TODO(roman): This is clearly broken. Fix it.
- local eb_env=$(grep environment .elasticbeanstalk/config.yml 2> /dev/null | awk '{print $2}')
- if [[ -n "$eb_env" ]]; then
- "$1_prompt_segment" "$0" "$2" black green 'AWS_EB_ICON' 0 '' "${eb_env//\%/%%}"
- fi
+ [[ -r .elasticbeanstalk/config.yml ]] || return
+ local v=${=$(grep environment .elasticbeanstalk/config.yml 2>/dev/null)[2]}
+ [[ -n $v ]] && "$1_prompt_segment" "$0" "$2" black green 'AWS_EB_ICON' 0 '' "${v//\%/%%}"
}
################################################################