From 72c5b034cadcc8a13d64c316508a3fbe1ffdf11e Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Thu, 2 Feb 2023 18:14:42 +0300 Subject: [PATCH] Avoid the need to filter out envs in `pyenv-latest' --- libexec/pyenv-latest | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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=(\