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

Merge pull request #2037 from NyaMisty/master

[Fixed] Adapt conda.bash for bash associative array
pull/2043/head
Anton Petrov 4 лет назад
committed by GitHub
Родитель
Сommit
b2eb2d28d1
Не найден GPG ключ соответствующий данной подписи Идентификатор GPG ключа: 4AEE18F83AFDEB23
1 измененных файлов: 17 добавлений и 8 удалений
  1. +17
    -8
      pyenv.d/rehash/conda.bash

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

@ -34,14 +34,23 @@ make_shims() {
}
deregister_conda_shims() {
local shim
local shims=()
for shim in ${registered_shims}; do
if ! conda_shim "${shim}" 1>&2; then
shims[${#shims[*]}]="${shim}"
fi
done
registered_shims=" ${shims[@]} "
# adapted for Bash 4.x's associative array (#1749)
if declare -p registered_shims 2> /dev/null | grep -Eq '^(declare|typeset) \-A'; then
for shim in ${!registered_shims[*]}; do
if conda_shim "${shim}" 1>&2; then
unset registered_shims[${shim}]
fi
done
else
local shim
local shims=()
for shim in ${registered_shims}; do
if ! conda_shim "${shim}" 1>&2; then
shims[${#shims[*]}]="${shim}"
fi
done
registered_shims=" ${shims[@]} "
fi
}
if conda_exists; then

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