Skip to content

Commit

Permalink
pyenv hooks to zsh
Browse files Browse the repository at this point in the history
  • Loading branch information
Maxattax97 committed Nov 8, 2024
1 parent 5edb329 commit 821cdfd
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
Expand Up @@ -449,6 +449,11 @@ zshrc_source() {
if [ -s "$HOME/.luaver/luaver" ]; then
source "$HOME/.luaver/luaver"
fi

if [ -n "${PYENV_ROOT}" ]; then
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
fi
}

zshrc_set_options() {
Expand Down Expand Up @@ -904,6 +909,10 @@ zshrc_set_path() {
zshrc_add_path "${KREW_ROOT:-$HOME/.krew}/bin" before
if [ -n "${PYENV_ROOT}" ]; then
zshrc_add_path "${PYENV_ROOT}/bin" before
fi
# Always wins, these are mine.
zshrc_add_path "${HOME}/bin" before
}
Expand Down Expand Up @@ -2012,6 +2021,10 @@ zshrc_set_environment_variables() {
# Python on macOS uses ~/Library/Python/X.Y/lib/python/site-packages
# ... this is madness, unify them.
export PYTHONUSERBASE="$HOME/.local"
if [ -d "${HOME}/.pyenv" ]; then
export PYENV_ROOT="${HOME}/.pyenv"
fi
}
zshrc_aura_shrc() {
Expand Down

0 comments on commit 821cdfd

Please sign in to comment.