diff --git a/pyenv.d/which/anaconda.bash b/pyenv.d/which/anaconda.bash new file mode 100644 index 00000000..b0c7d97a --- /dev/null +++ b/pyenv.d/which/anaconda.bash @@ -0,0 +1,112 @@ +# Anaconda comes with binaries of system packages (e.g. `openssl`, `curl`). +# Creating shims for those binaries will prevent pyenv users to run those +# commands normally when not using Anaconda. +# +# This is a limited edition of https://github.com/yyuu/pyenv-which-ext +# and it will looks for original `PATH` if there is Anaconda/Miniconda +# installed and the command name is blacklisted. + +conda_exists() { + shopt -s nullglob + local condas=($(echo "${PYENV_ROOT}/versions/"*"/bin/conda" "${PYENV_ROOT}/versions/"*"/envs/"*"/bin/conda")) + shopt -u nullglob + [ -n "${condas}" ] +} + +conda_shims() { + cat <