-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pyenv-virtualenv_optional_setup.sh
33 lines (30 loc) · 1.16 KB
/
.pyenv-virtualenv_optional_setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#
# This script contains the instuctions generated by:
# $(pyenv virtualenv-init -)
# So they can be inspected or partially executed.
# It doesn't need to be sourced if the above statement is eval'd in
# .zshenv/.bashrc/.bash_profile
#
# -------------------------------------------------------------------------------
# -------------------------------------------------------------------------------
# ,-------------------------,
# | pyenv virtualenv-init - |
# '-------------------------'
# enable auto-activation of virtualenvs
# otherwise, they can be manually activated with 'pyenv activate'
# add shims to front of $PATH
# export PATH="/home/troy/.pyenv/plugins/pyenv-virtualenv/shims:${PATH}";
pathprepend "/home/troy/.pyenv/plugins/pyenv-virtualenv/shims:${PATH}";
# set $PYENV-VIRTUALENV-INIT
export PYENV_VIRTUALENV_INIT=1;
if [[ -z $pyenv_virtualenv_noauto ]]; then
_pyenv_virtualenv_hook() {
local ret=$?
if [ -n "$VIRTUAL_ENV" ]; then
eval "$(pyenv sh-activate --quiet || pyenv sh-deactivate --quiet || true)" || true
else
eval "$(pyenv sh-activate --quiet || true)" || true
fi
return $ret
};
fi