python: improve PYENV_ROOT detection

main
laggardkernel 6 years ago committed by Kaleb Elwert
parent 61de4d199d
commit f596d5d1d6

@ -8,17 +8,12 @@
# #
# Load manually installed pyenv into the path # Load manually installed pyenv into the path
if [[ -n "$PYENV_ROOT" && -s "$PYENV_ROOT/bin/pyenv" ]]; then if [[ -s "${PYENV_ROOT:=$HOME/.pyenv}/bin/pyenv" ]]; then
path=("$PYENV_ROOT/bin" $path) path=("${PYENV_ROOT}/bin" $path)
elif [[ -s "$HOME/.pyenv/bin/pyenv" ]]; then eval "$(pyenv init - --no-rehash zsh)"
path=("$HOME/.pyenv/bin" $path)
fi
# Load pyenv into the current python session # Load pyenv into the current python session
if (( $+commands[pyenv] )); then elif (( $+commands[pyenv] )); then
if [[ -z "$PYENV_ROOT" ]]; then
export PYENV_ROOT=$(pyenv root)
fi
eval "$(pyenv init - --no-rehash zsh)" eval "$(pyenv init - --no-rehash zsh)"
# Prepend PEP 370 per user site packages directory, which defaults to # Prepend PEP 370 per user site packages directory, which defaults to

Loading…
Cancel
Save