Browse Source

initial

master
Lucas 9 months ago
commit
fe0079b3e2
  1. 23
      pyenv_lazy.sh

23
pyenv_lazy.sh

@ -0,0 +1,23 @@
# 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
Loading…
Cancel
Save