You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
23 lines
801 B
23 lines
801 B
# Try to find pyenv, if it's not on the path
|
|
#https://github.com/davidparsson/zsh-pyenv-lazy
|
|
#https://github.com/Ttayu/zsh-pyenv-lazy/tree/fix/prevent_overwriting_path
|
|
export PYENV_ROOT="${PYENV_ROOT:=${HOME}/.pyenv}"
|
|
if ! type pyenv > /dev/null && [ -f "${PYENV_ROOT}/bin/pyenv" ]; then
|
|
export PATH="${PYENV_ROOT}/bin:${PATH}"
|
|
fi
|
|
|
|
# Lazy load pyenv
|
|
if type pyenv > /dev/null; then
|
|
# export PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
|
|
if [[ ! -n "${VIRTUAL_ENV}" ]]; then
|
|
export PATH="${PYENV_ROOT}/bin:${PYENV_ROOT}/shims:${PATH}"
|
|
fi
|
|
function pyenv() {
|
|
unset -f pyenv
|
|
eval "$(command pyenv init -)"
|
|
if [[ -n "${ZSH_PYENV_LAZY_VIRTUALENV}" ]]; then
|
|
eval "$(command pyenv virtualenv-init -)"
|
|
fi
|
|
pyenv $@
|
|
}
|
|
fi
|
|
|