Merge pull request #2027 from NyaMisty/master
Adapt conda.bash for bash associative array
This commit is contained in:
commit
3738c2a282
@ -34,14 +34,22 @@ make_shims() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
deregister_conda_shims() {
|
deregister_conda_shims() {
|
||||||
local shim
|
if [[ -v registered_shims[@] ]]; then # adapted for Bash 4.x's associative array (#1749)
|
||||||
local shims=()
|
for shim in ${!registered_shims[*]}; do
|
||||||
for shim in ${registered_shims}; do
|
if conda_shim "${shim}" 1>&2; then
|
||||||
if ! conda_shim "${shim}" 1>&2; then
|
unset registered_shims[${shim}]
|
||||||
shims[${#shims[*]}]="${shim}"
|
fi
|
||||||
fi
|
done
|
||||||
done
|
else
|
||||||
registered_shims=" ${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[@]} "
|
||||||
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
if conda_exists; then
|
if conda_exists; then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user