From ac07d63780d838d54d51d19cf72796c7d5edaf60 Mon Sep 17 00:00:00 2001 From: "Yamashita, Yuu" Date: Tue, 26 Jul 2016 07:47:02 +0000 Subject: [PATCH] Add workaround for conflict of `rehash` hook between pyenv-virtualenv --- pyenv.d/rehash/anaconda.bash | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/pyenv.d/rehash/anaconda.bash b/pyenv.d/rehash/anaconda.bash index 1bd4cfc1..2963288c 100644 --- a/pyenv.d/rehash/anaconda.bash +++ b/pyenv.d/rehash/anaconda.bash @@ -53,6 +53,18 @@ conda_shim() { return 1 } +# override `make_shims` to avoid conflict between pyenv-virtualenv's `envs.bash` +# https://github.com/yyuu/pyenv-virtualenv/blob/v20160716/etc/pyenv.d/rehash/envs.bash +make_shims() { + local file shim + for file do + shim="${file##*/}" + if ! conda_shim "${shim}" 1>&2; then + register_shim "$shim" + fi + done +} + deregister_conda_shims() { local shim local shims=() @@ -61,7 +73,7 @@ deregister_conda_shims() { shims[${#shims[*]}]="${shim}" fi done - registered_shims="${shims[@]}" + registered_shims=" ${shims[@]} " } if conda_exists; then