Skip to content

Instantly share code, notes, and snippets.

@tek
Created December 20, 2015 16:27
Show Gist options
  • Save tek/676744f01fa56c5b3cae to your computer and use it in GitHub Desktop.
Save tek/676744f01fa56c5b3cae to your computer and use it in GitHub Desktop.
_setup_pyenv_plugin_dir()
{
for plugin ($PYENV_PLUGINS/*(/)) {
if ! [[ -e $PYENV_PLUGIN_DIR/${plugin:t} ]] {
ln -s $plugin $PYENV_ROOT/plugins
}
}
}
pyenvstart()
{
export PYENV_ROOT="$HOME/usr/opt/pyenv"
export PYENV_PLUGIN_DIR="$PYENV_ROOT/plugins"
export PYENV_PLUGINS="$HOME/usr/opt/pyenv-plugins"
if [[ -d $PYENV_ROOT ]] {
export PATH="$PYENV_ROOT/bin:$PATH"
_setup_pyenv_plugin_dir
eval "$(pyenv init -)"
export PYENV_VERSION="$(pyenv version-name)"
export PYENV_PY="$(pyenv prefix)/lib/python${PYENV_VERSION[1,3]}"
export PYENV_SITE="$PYENV_PY/site-packages"
} else {
print 'pyenv missing!'
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment