Просмотр исходного кода

Merge pull request #1350 from maxbrunet/feature/versions/dotglob

List versions starting with a dot
pull/1874/head
Anton Petrov 5 лет назад
committed by GitHub
Родитель
Сommit
2924886a77
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
3 измененных файлов: 11 добавлений и 4 удалений
  1. +2
    -2
      libexec/pyenv-versions
  2. +2
    -2
      pyenv.d/rehash/conda.bash
  3. +7
    -0
      test/versions.bats

+ 2
- 2
libexec/pyenv-versions Просмотреть файл

@ -122,7 +122,7 @@ if [ -n "$include_system" ] && \
print_version system
fi
shopt -s nullglob
shopt -s dotglob nullglob
for path in "$versions_dir"/*; do
if [ -d "$path" ]; then
if [ -n "$skip_aliases" ] && [ -L "$path" ]; then
@ -139,7 +139,7 @@ for path in "$versions_dir"/*; do
done
fi
done
shopt -u nullglob
shopt -u dotglob nullglob
if [ "$num_versions" -eq 0 ] && [ -n "$include_system" ]; then
echo "Warning: no Python detected on the system" >&2

+ 2
- 2
pyenv.d/rehash/conda.bash Просмотреть файл

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

+ 7
- 0
test/versions.bats Просмотреть файл

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

Загрузка…
Отмена
Сохранить