ask rbenv for current version instead of reading rbenv/version file
This commit is contained in:
parent
fae42395f5
commit
8812584047
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user