diff --git a/libexec/pyenv-latest b/libexec/pyenv-latest index 5c247105..d4c44b60 100755 --- a/libexec/pyenv-latest +++ b/libexec/pyenv-latest @@ -31,7 +31,7 @@ exitcode=0 IFS=$'\n' if [[ -z $FROM_KNOWN ]]; then - DEFINITION_CANDIDATES=( $(pyenv-versions --bare) ) + DEFINITION_CANDIDATES=( $(pyenv-versions --bare --skip-envs) ) else DEFINITION_CANDIDATES=( $(python-build --definitions ) ) fi @@ -48,10 +48,9 @@ IFS=$'\n' $(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \ grep -Ee "^$prefix_re[-.]" || true)) - #FIXME: /envs/ should be excluded in Pyenv-Virtualenv via a hook DEFINITION_CANDIDATES=(\ $(printf '%s\n' "${DEFINITION_CANDIDATES[@]}" | \ - sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d' -e '/\/envs\//d')); + sed -E -e '/-dev$/d' -e '/-src$/d' -e '/-latest$/d' -e '/(a|b|rc)[0-9]+$/d')); # Compose a sorting key, followed by | and original value DEFINITION_CANDIDATES=(\