no need optional pyenv init
This commit is contained in:
parent
192ece1f62
commit
143b1b5362
1 changed files with 22 additions and 24 deletions
|
@ -7,32 +7,30 @@
|
|||
# Patrick Bos <egpbos@gmail.com>
|
||||
#
|
||||
|
||||
if zstyle -t ':prezto:module:python:pyenv' auto-init 'yes'; then
|
||||
# Load manually installed pyenv into the shell session.
|
||||
if [[ -s "$HOME/.pyenv/bin/pyenv" ]] && (( ! $+commands[pyenv] )); then
|
||||
path=("$HOME/.pyenv/bin" $path)
|
||||
export PYENV_ROOT=$(pyenv root)
|
||||
# Load manually installed pyenv into the shell session.
|
||||
if [[ -s "$HOME/.pyenv/bin/pyenv" ]] && (( ! $+commands[pyenv] )); then
|
||||
path=("$HOME/.pyenv/bin" $path)
|
||||
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
|
||||
|
||||
# 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
|
||||
|
||||
# Prepend PEP 370 per user site packages directory, which defaults to
|
||||
# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The
|
||||
# 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
|
||||
# Prepend PEP 370 per user site packages directory, which defaults to
|
||||
# ~/Library/Python on macOS and ~/.local elsewhere, to PATH. The
|
||||
# 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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue