List versions starting with a dot

This commit is contained in:
Maxime Brunet 2019-06-02 16:00:36 -04:00
parent 7dd50144d5
commit 2b174ab69f
3 changed files with 11 additions and 4 deletions

View file

@ -106,7 +106,7 @@ if [ -n "$include_system" ] && PYENV_VERSION=system pyenv-which python >/dev/nul
print_version system print_version system
fi fi
shopt -s nullglob shopt -s dotglob nullglob
for path in "$versions_dir"/*; do for path in "$versions_dir"/*; do
if [ -d "$path" ]; then if [ -d "$path" ]; then
if [ -n "$skip_aliases" ] && [ -L "$path" ]; then if [ -n "$skip_aliases" ] && [ -L "$path" ]; then
@ -123,7 +123,7 @@ for path in "$versions_dir"/*; do
done done
fi fi
done done
shopt -u nullglob shopt -u dotglob nullglob
if [ "$num_versions" -eq 0 ] && [ -n "$include_system" ]; then if [ "$num_versions" -eq 0 ] && [ -n "$include_system" ]; then
echo "Warning: no Python detected on the system" >&2 echo "Warning: no Python detected on the system" >&2

View file

@ -5,9 +5,9 @@
# This hooks is intended to skip creating shims for those executables. # This hooks is intended to skip creating shims for those executables.
conda_exists() { conda_exists() {
shopt -s nullglob shopt -s dotglob nullglob
local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda")) local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda"))
shopt -u nullglob shopt -u dotglob nullglob
[ -n "${condas}" ] [ -n "${condas}" ]
} }

View file

@ -154,3 +154,10 @@ OUT
1.9 1.9
OUT OUT
} }
@test "lists dot directories under versions" {
create_version ".venv"
run pyenv-versions --bare
assert_success ".venv"
}