Show venvs created from system Python

Venvs created from system Python are directories, not sym links. The previous
code only displayed venvs that were a directory and a symlink. Now check for
directory existence and symlink status, or directory existence and the presence
of bin/activate within the directory.
This commit is contained in:
Sam Doran 2026-04-24 16:02:44 -04:00
parent 7e89747ae8
commit 19efcdcd80
No known key found for this signature in database
GPG key ID: 01602635F94328AA

View file

@ -116,13 +116,17 @@ for env_path in "${venv_dir_entries[@]}"; do
fi
done
if [[ -z "$skip_aliases" ]]; then
for env_path in "${version_dir_entries[@]}"; do
if [[ -d ${env_path} ]] && [[ -L ${env_path} ]]; then
for env_path in "${version_dir_entries[@]}"; do
if [[ -d ${env_path} ]]; then
if [[ -L ${env_path} ]]; then
if [[ -z $skip_aliases ]]; then
print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}"
fi
elif [[ -f "${env_path}/bin/activate" ]]; then
print_version "${env_path#"${PYENV_ROOT}"/versions/}" "${env_path}"
fi
done
fi
fi
done
shopt -u dotglob
shopt -u nullglob