From dd86f543fc77b758573fd2b34b6792228ca21159 Mon Sep 17 00:00:00 2001 From: Jeffrey 'jf' Lim Date: Wed, 8 Jan 2020 15:54:33 +0800 Subject: [PATCH] libexec/rbenv-version: get rid of misleading "set by $(rbenv-version-origin)" message when system ruby is in use --- libexec/rbenv-version | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libexec/rbenv-version b/libexec/rbenv-version index d1fefcc5..60922b69 100755 --- a/libexec/rbenv-version +++ b/libexec/rbenv-version @@ -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