From 07609cc579a9e4552f78e30d81a77c0bbece251b Mon Sep 17 00:00:00 2001 From: Anton Petrov Date: Fri, 20 Aug 2021 09:58:18 +0300 Subject: [PATCH] Revert "Adapt conda.bash for bash associative array" --- pyenv.d/rehash/conda.bash | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/pyenv.d/rehash/conda.bash b/pyenv.d/rehash/conda.bash index bfc88b31..9e477862 100644 --- a/pyenv.d/rehash/conda.bash +++ b/pyenv.d/rehash/conda.bash @@ -34,22 +34,14 @@ make_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 shims=() - for shim in ${registered_shims}; do - if ! conda_shim "${shim}" 1>&2; then - shims[${#shims[*]}]="${shim}" - fi - done - registered_shims=" ${shims[@]} " - fi + 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 conda_exists; then