no need optional pyenv init

This commit is contained in:
arshavindn 2018-08-20 14:07:10 +07:00
parent 192ece1f62
commit 143b1b5362

View file

@ -7,32 +7,30 @@
# Patrick Bos <egpbos@gmail.com> # Patrick Bos <egpbos@gmail.com>
# #
if zstyle -t ':prezto:module:python:pyenv' auto-init 'yes'; then # Load manually installed pyenv into the shell session.
# Load manually installed pyenv into the shell session. if [[ -s "$HOME/.pyenv/bin/pyenv" ]] && (( ! $+commands[pyenv] )); then
if [[ -s "$HOME/.pyenv/bin/pyenv" ]] && (( ! $+commands[pyenv] )); then path=("$HOME/.pyenv/bin" $path)
path=("$HOME/.pyenv/bin" $path) export PYENV_ROOT=$(pyenv root)
export PYENV_ROOT=$(pyenv root) fi
# Return if requirements are not found.
if (( ! $+commands[python] && ! $+commands[pyenv] )); then
return 1
elif (( $+commands[python] )); then
if (( $+commands[pyenv] )) && [[ -z "$PYENV_SHELL" ]]; then
eval "$(pyenv init - --no-rehash zsh)"
fi fi
# Return if requirements are not found. # Prepend PEP 370 per user site packages directory, which defaults to
if (( ! $+commands[python] && ! $+commands[pyenv] )); then # ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The
return 1 # path can be overridden using PYTHONUSERBASE.
elif (( $+commands[python] )); then if [[ -n "$PYTHONUSERBASE" ]]; then
if (( $+commands[pyenv] )) && [[ -z "$PYENV_SHELL" ]]; then path=($PYTHONUSERBASE/bin $path)
eval "$(pyenv init - --no-rehash zsh)" elif [[ "$OSTYPE" == darwin* ]]; then
fi path=($HOME/Library/Python/*/bin(N) $path)
else
# Prepend PEP 370 per user site packages directory, which defaults to # This is subject to change.
# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The path=($HOME/.local/bin $path)
# path can be overridden using PYTHONUSERBASE.
if [[ -n "$PYTHONUSERBASE" ]]; then
path=($PYTHONUSERBASE/bin $path)
elif [[ "$OSTYPE" == darwin* ]]; then
path=($HOME/Library/Python/*/bin(N) $path)
else
# This is subject to change.
path=($HOME/.local/bin $path)
fi
fi fi
fi fi