1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-29 06:40:08 +00:00

rvm: handle -head, etc. more gracefully.

Closes #575
This commit is contained in:
Christian Höltje 2017-07-26 23:39:49 -04:00
parent 0bcef50e29
commit be6c032025

View file

@ -1070,13 +1070,10 @@ prompt_rspec_stats() {
# Ruby Version Manager information # Ruby Version Manager information
prompt_rvm() { prompt_rvm() {
local gemset=$(echo $GEM_HOME | awk -F'@' '{print $2}') local version_and_gemset=${rvm_env_string/ruby-}
[ "$gemset" != "" ] && gemset="@$gemset"
local version=$(echo $MY_RUBY_HOME | awk -F'-' '{print $NF}') if [[ -n "$version_and_gemset" ]]; then
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version_and_gemset" 'RUBY_ICON'
if [[ -n "$version$gemset" ]]; then
"$1_prompt_segment" "$0" "$2" "240" "$DEFAULT_COLOR" "$version$gemset" 'RUBY_ICON'
fi fi
} }