1
0
mirror of https://github.com/pyenv/pyenv.git synced 2025-11-12 05:23:47 -05:00

Merge pull request #2027 from NyaMisty/master

Adapt conda.bash for bash associative array
This commit is contained in:
Anton Petrov
2021-08-19 19:38:25 +03:00
committed by GitHub

View File

@@ -34,6 +34,13 @@ make_shims() {
} }
deregister_conda_shims() { deregister_conda_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 shim
local shims=() local shims=()
for shim in ${registered_shims}; do for shim in ${registered_shims}; do
@@ -42,6 +49,7 @@ deregister_conda_shims() {
fi fi
done done
registered_shims=" ${shims[@]} " registered_shims=" ${shims[@]} "
fi
} }
if conda_exists; then if conda_exists; then