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,12 +15,15 @@
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)
elif [[ -d ~/.rbenv/ ]]; then
ruby_version=$(<~/.rbenv/version)
fi
if [ -n "$ruby_version" ]; then if [ -n "$ruby_version" ]; then
echo "[$ruby_version]" echo "[$ruby_version]"
fi fi
elif [[ -d ~/.rbenv/ ]]; then
ruby_version=(${(s: :)$(rbenv version)})
if [ -n "$ruby_version" ]; then
echo "[${ruby_version[1]}]"
fi
fi
} }
function prompt_skwp_precmd { function prompt_skwp_precmd {