ask rbenv for current version instead of reading rbenv/version file

This commit is contained in:
Wes Morgan 2012-10-23 11:58:50 -06:00
parent fae42395f5
commit 8812584047

View File

@ -15,11 +15,14 @@
function rvm_info_for_prompt { function rvm_info_for_prompt {
if [[ -d ~/.rvm/ ]]; then if [[ -d ~/.rvm/ ]]; then
ruby_version=$(~/.rvm/bin/rvm-prompt) ruby_version=$(~/.rvm/bin/rvm-prompt)
if [ -n "$ruby_version" ]; then
echo "[$ruby_version]"
fi
elif [[ -d ~/.rbenv/ ]]; then elif [[ -d ~/.rbenv/ ]]; then
ruby_version=$(<~/.rbenv/version) ruby_version=(${(s: :)$(rbenv version)})
fi if [ -n "$ruby_version" ]; then
if [ -n "$ruby_version" ]; then echo "[${ruby_version[1]}]"
echo "[$ruby_version]" fi
fi fi
} }