This commit is contained in:
k 2026-05-03 22:50:27 +00:00 committed by GitHub
commit 39145128b3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 6 deletions

View file

@ -112,8 +112,10 @@ EOS
;;
* )
cat <<EOS
export PATH="${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
if [[ ":$PATH:" != *"${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims"* ]]; then
export PATH="${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
EOS
;;
esac

View file

@ -46,8 +46,10 @@ load test_helper
run pyenv-virtualenv-init - bash
assert_success
assert_output <<EOS
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
if [[ ":$PATH:" != *"${TMP}/pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
_pyenv_virtualenv_hook() {
local ret=\$?
if [ "\${PYENV_VERSION-}" = "\${_PYENV_VH_VERSION-}" ] \\
@ -156,8 +158,10 @@ EOS
run pyenv-virtualenv-init - zsh
assert_success
assert_output <<EOS
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
if [[ ":$PATH:" != *"${TMP}/pyenv/plugins/pyenv-virtualenv/shims"* ]]; then
export PATH="${TMP}/pyenv/plugins/pyenv-virtualenv/shims:\${PATH}";
export PYENV_VIRTUALENV_INIT=1;
fi
_pyenv_virtualenv_hook() {
local ret=\$?
if [ "\${PYENV_VERSION-}" = "\${_PYENV_VH_VERSION-}" ] \\