libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use

This commit is contained in:
Jeffrey 'jf' Lim 2020-01-08 15:54:33 +08:00
parent c46a970595
commit dd86f543fc

View file

@ -8,4 +8,9 @@
set -e
[ -n "$RBENV_DEBUG" ] && set -x
echo "$(rbenv-version-name) (set by $(rbenv-version-origin))"
RBENV_VERSION_FILE="$(rbenv-version-origin)"
if [ -e "$RBENV_VERSION_FILE" ]; then
echo "$(rbenv-version-name) (set by $RBENV_VERSION_FILE)"
else
echo "$(rbenv-version-name)"
fi