mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-14 20:39:55 -05:00
Adapt conda.bash for bash associative array
This commit is contained in:
parent
d209e0612b
commit
351ddb1095
1 changed files with 16 additions and 8 deletions
|
@ -34,14 +34,22 @@ 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[@]} "
|
||||
if [[ -v registered_shims[@] ]]; then # adapted for Bash 4.x's associative array (#1749)
|
||||
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
|
||||
|
|
Loading…
Reference in a new issue