summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Hilburn <bhilburn@gmail.com>2017-07-27 14:38:37 +0300
committerGitHub <noreply@github.com>2017-07-27 14:38:37 +0300
commit176559a050e884964122202cc329d0b174366500 (patch)
tree8e01eec96cddedd24a71b5222b0f7390fb31371d
parent0bcef50e29f55c2858457c8a06da3219b1911a85 (diff)
parentbe6c0320252d2c750884a90664a26b58eb824920 (diff)
Merge pull request #583 from docwhat/pr/rvm-575
rvm: handle -head, etc. more gracefully.
-rwxr-xr-xpowerlevel9k.zsh-theme9
1 files changed, 3 insertions, 6 deletions
diff --git a/powerlevel9k.zsh-theme b/powerlevel9k.zsh-theme
index 16904af7..d6ce38f1 100755
--- a/powerlevel9k.zsh-theme
+++ b/powerlevel9k.zsh-theme
@@ -1070,13 +1070,10 @@ prompt_rspec_stats() {
# Ruby Version Manager information
prompt_rvm() {
- local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}')
- [ "$gemset" != "" ] && gemset="@$gemset"
+ local version_and_gemset=${rvm_env_string/ruby-}
- local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $NF}')
-
- if [[ -n "$version$gemset" ]]; then
- "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version$gemset" 'RUBY_ICON'
+ if [[ -n "$version_and_gemset" ]]; then
+ "$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON'
fi
}