mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
libexec/rbenv-version{,-origin}: move "missing rbenv-version-file detection" logic as per @mislav
This commit is contained in:
parent
40db754168
commit
302797ba41
2 changed files with 7 additions and 8 deletions
|
@ -8,9 +8,11 @@
|
||||||
set -e
|
set -e
|
||||||
[ -n "$RBENV_DEBUG" ] && set -x
|
[ -n "$RBENV_DEBUG" ] && set -x
|
||||||
|
|
||||||
RBENV_VERSION_ORIGIN="$(rbenv-version-origin)"
|
version_name="$(rbenv-version-name)"
|
||||||
if [ -z "$RBENV_VERSION_ORIGIN" ]; then
|
version_origin="$(rbenv-version-origin)"
|
||||||
echo "$(rbenv-version-name)"
|
|
||||||
|
if [ "$version_origin" = "${RBENV_ROOT}/version" ] && [ ! -e "$version_origin" ]; then
|
||||||
|
echo "$version_name"
|
||||||
else
|
else
|
||||||
echo "$(rbenv-version-name) (set by $RBENV_VERSION_ORIGIN)"
|
echo "$version_name (set by $version_origin)"
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -17,8 +17,5 @@ if [ -n "$RBENV_VERSION_ORIGIN" ]; then
|
||||||
elif [ -n "$RBENV_VERSION" ]; then
|
elif [ -n "$RBENV_VERSION" ]; then
|
||||||
echo "RBENV_VERSION environment variable"
|
echo "RBENV_VERSION environment variable"
|
||||||
else
|
else
|
||||||
RBENV_VERSION_FILE="$(rbenv-version-file)"
|
rbenv-version-file
|
||||||
if [ -e "$RBENV_VERSION_FILE" ]; then
|
|
||||||
echo $RBENV_VERSION_FILE
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue