mirror of
https://github.com/pyenv/pyenv.git
synced 2025-02-16 19:11:33 +00:00
fixes checking of associative array in conda.bash
This commit is contained in:
parent
4f8b15fecd
commit
dfeda54079
1 changed files with 17 additions and 8 deletions
|
@ -34,6 +34,14 @@ make_shims() {
|
||||||
}
|
}
|
||||||
|
|
||||||
deregister_conda_shims() {
|
deregister_conda_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 shim
|
||||||
local shims=()
|
local shims=()
|
||||||
for shim in ${registered_shims}; do
|
for shim in ${registered_shims}; do
|
||||||
|
@ -42,6 +50,7 @@ deregister_conda_shims() {
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
registered_shims=" ${shims[@]} "
|
registered_shims=" ${shims[@]} "
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if conda_exists; then
|
if conda_exists; then
|
||||||
|
|
Loading…
Reference in a new issue