initial
This commit is contained in:
commit
fe0079b3e2
1 changed files with 23 additions and 0 deletions
23
pyenv_lazy.sh
Normal file
23
pyenv_lazy.sh
Normal file
|
|
@ -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…
Add table
Add a link
Reference in a new issue