File tree 2 files changed +12
-6
lines changed
2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 95
95
;;
96
96
* )
97
97
cat << EOS
98
- export PATH="${PYENV_VIRTUALENV_ROOT:- ${PYENV_VIRTUALENV_INSTALL_PREFIX} } /shims:\$ {PATH}";
99
- export PYENV_VIRTUALENV_INIT=1;
98
+ if [[ ":$PATH :" != *"${PYENV_VIRTUALENV_ROOT:- ${PYENV_VIRTUALENV_INSTALL_PREFIX} } /shims"* ]]; then
99
+ export PATH="${PYENV_VIRTUALENV_ROOT:- ${PYENV_VIRTUALENV_INSTALL_PREFIX} } /shims:\$ {PATH}";
100
+ export PYENV_VIRTUALENV_INIT=1;
101
+ fi
100
102
EOS
101
103
;;
102
104
esac
Original file line number Diff line number Diff line change @@ -50,8 +50,10 @@ load test_helper
50
50
run pyenv-virtualenv-init - bash
51
51
assert_success
52
52
assert_output << EOS
53
- export PATH="${TMP} /pyenv/plugins/pyenv-virtualenv/shims:\$ {PATH}";
54
- export PYENV_VIRTUALENV_INIT=1;
53
+ if [[ ":$PATH :" != *"${TMP} /pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
54
+ export PATH="${TMP} /pyenv/plugins/pyenv-virtualenv/shims:\$ {PATH}";
55
+ export PYENV_VIRTUALENV_INIT=1;
56
+ fi
55
57
_pyenv_virtualenv_hook() {
56
58
local ret=\$ ?
57
59
if [ -n "\$ {VIRTUAL_ENV-}" ]; then
93
95
run pyenv-virtualenv-init - zsh
94
96
assert_success
95
97
assert_output << EOS
96
- export PATH="${TMP} /pyenv/plugins/pyenv-virtualenv/shims:\$ {PATH}";
97
- export PYENV_VIRTUALENV_INIT=1;
98
+ if [[ ":$PATH :" != *"${TMP} /pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
99
+ export PATH="${TMP} /pyenv/plugins/pyenv-virtualenv/shims:\$ {PATH}";
100
+ export PYENV_VIRTUALENV_INIT=1;
101
+ fi
98
102
_pyenv_virtualenv_hook() {
99
103
local ret=\$ ?
100
104
if [ -n "\$ {VIRTUAL_ENV-}" ]; then
You can’t perform that action at this time.
0 commit comments