diff options
author | Christian Höltje <docwhat@gerf.org> | 2017-07-27 06:39:49 +0300 |
---|---|---|
committer | Christian Höltje <docwhat@gerf.org> | 2017-07-27 06:39:49 +0300 |
commit | be6c0320252d2c750884a90664a26b58eb824920 (patch) | |
tree | 8e01eec96cddedd24a71b5222b0f7390fb31371d /powerlevel9k.zsh-theme | |
parent | 0bcef50e29f55c2858457c8a06da3219b1911a85 (diff) |
rvm: handle -head, etc. more gracefully.
Closes #575
Diffstat (limited to 'powerlevel9k.zsh-theme')
-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 } |