diff options
author | Ben Hilburn <bhilburn@gmail.com> | 2017-07-27 14:38:37 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 14:38:37 +0300 |
commit | 176559a050e884964122202cc329d0b174366500 (patch) | |
tree | 8e01eec96cddedd24a71b5222b0f7390fb31371d | |
parent | 0bcef50e29f55c2858457c8a06da3219b1911a85 (diff) | |
parent | be6c0320252d2c750884a90664a26b58eb824920 (diff) |
Merge pull request #583 from docwhat/pr/rvm-575
rvm: handle -head, etc. more gracefully.
-rwxr-xr-x | powerlevel9k.zsh-theme | 9 |
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 } |