diff --git a/etc/pyenv.d/which/whence.bash b/etc/pyenv.d/which/whence.bash index 889436c..7faf04f 100755 --- a/etc/pyenv.d/which/whence.bash +++ b/etc/pyenv.d/which/whence.bash @@ -1,6 +1,9 @@ if [ -n "$PYENV_COMMAND" ] && [ ! -x "$PYENV_COMMAND_PATH" ]; then versions=($(pyenv-whence "${PYENV_COMMAND}" 2>/dev/null || true)) - if [ "${#versions[@]}" -eq 1 ]; then - PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${versions[0]}/bin/${PYENV_COMMAND}" + if [ -n "${versions}" ]; then + if [ "${#versions[@]}" -gt 1 ]; then + echo "pyenv-implicit: found multiple ${PYENV_COMMAND} in pyenv. Use version ${versions[-1]}." 1>&2 + fi + PYENV_COMMAND_PATH="${PYENV_ROOT}/versions/${versions[-1]}/bin/${PYENV_COMMAND}" fi fi