File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -52,13 +52,18 @@ while [ $# -gt 0 ]; do
52
52
shift 1
53
53
done
54
54
55
+ get_current_versions () {
56
+ local IFS=:
57
+ current_versions=($( pyenv-version-name 2> /dev/null) )
58
+ }
59
+
55
60
no_shell=
56
61
versions=(" $@ " )
62
+ current_versions=()
57
63
if [ -z " ${versions} " ]; then
58
64
no_shell=1
59
- OLDIFS=" $IFS "
60
- IFS=: versions=($( pyenv-version-name 2> /dev/null) )
61
- IFS=" $OLDIFS "
65
+ get_current_versions
66
+ versions=(" ${current_versions[@]} " )
62
67
fi
63
68
64
69
if [ -z " ${PYENV_VIRTUALENV_INIT} " ]; then
84
89
85
90
if ! pyenv-virtualenv-prefix " ${venv} " 1> /dev/null 2>&1 ; then
86
91
# fallback to virtualenv of current version
87
- OLDIFS=" $IFS "
88
- IFS=: current_versions=($( pyenv-version-name) )
89
- IFS=" $OLDIFS "
92
+ [ -n " ${current_versions} " ] || get_current_versions
90
93
new_venv=" ${current_versions%/ envs/* } /envs/${venv} "
91
94
if pyenv-virtualenv-prefix " ${new_venv} " 1> /dev/null 2>&1 ; then
92
95
venv=" ${new_venv} "
You can’t perform that action at this time.
0 commit comments