fix: PATH update for non-fish shells

Checks PATH variable for existing inclusion of shims
for shells other than fish.

See PR #430
This commit is contained in:
K Kollmann
2024-01-14 18:13:31 +01:00
parent 2b2b87a25a
commit 5d7894d189
2 changed files with 12 additions and 6 deletions

View File

@@ -95,8 +95,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