File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change 9595 ;;
9696* )
9797 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
100102EOS
101103 ;;
102104esac
Original file line number Diff line number Diff line change @@ -50,8 +50,10 @@ load test_helper
5050 run pyenv-virtualenv-init - bash
5151 assert_success
5252 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
5557_pyenv_virtualenv_hook() {
5658 local ret=\$ ?
5759 if [ -n "\$ {VIRTUAL_ENV-}" ]; then
9395 run pyenv-virtualenv-init - zsh
9496 assert_success
9597 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
98102_pyenv_virtualenv_hook() {
99103 local ret=\$ ?
100104 if [ -n "\$ {VIRTUAL_ENV-}" ]; then
You can’t perform that action at this time.
0 commit comments