-
Notifications
You must be signed in to change notification settings - Fork 0
/
.pyenv_optional_setup.sh
44 lines (38 loc) · 1.17 KB
/
.pyenv_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
34
35
36
37
38
39
40
41
42
43
44
#
# This script contains the instuctions generated by:
# $(pyenv 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 init - |
# '--------------'
# add shims to front of $PATH
# export PATH="/home/troy/.pyenv/shims:${PATH}"
pathprepend "/home/troy/.pyenv/shims:${PATH}"
# set $PYENV_SHELL
export PYENV_SHELL=${SHELL##*/}
# completions
source "/home/troy/.pyenv/completions/pyenv.${SHELL##*/}"
# rehash shims
command pyenv rehash 2>/dev/null
# define pyenv function (sh dispatcher), unless $pyenv_use_script
# -- this lets pyenv change variables in the shell session, allowing commands
# like 'pyenv shell'.
if [[ -z $pyenv_use_script ]]; then
pyenv() {
local command
command="$1"
if [ "$#" -gt 0 ]; then
shift
fi
case "$command" in
activate|deactivate|rehash|shell)
eval "$(pyenv "sh-$command" "$@")";;
*)
command pyenv "$command" "$@";;
esac
}
fi