1
0
Fork 0
mirror of https://github.com/romkatv/powerlevel10k.git synced 2024-11-17 10:10:07 +00:00

Merge pull request #583 from docwhat/pr/rvm-575

rvm: handle -head, etc. more gracefully.
This commit is contained in:
Ben Hilburn 2017-07-27 07:38:37 -04:00 committed by GitHub
commit 176559a050

View file

@ -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
}