mirror of
https://github.com/pyenv/pyenv-virtualenv.git
synced 2025-11-10 12:33:54 -05:00
Deduplicate shims in $PATH for the fish shell during initialization (#430)
When a fish login shell is invoked within an existing login shell, avoid duplicating path to the shims by removing existing occurrences before prepending.
This commit is contained in:
committed by
GitHub
parent
cc9d5f168e
commit
c6ff093344
@@ -86,6 +86,8 @@ fi
|
|||||||
case "$shell" in
|
case "$shell" in
|
||||||
fish )
|
fish )
|
||||||
cat <<EOS
|
cat <<EOS
|
||||||
|
while set index (contains -i -- "${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims" \$PATH)
|
||||||
|
set -eg PATH[\$index]; end; set -e index
|
||||||
set -gx PATH '${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims' \$PATH;
|
set -gx PATH '${PYENV_VIRTUALENV_ROOT:-${PYENV_VIRTUALENV_INSTALL_PREFIX}}/shims' \$PATH;
|
||||||
set -gx PYENV_VIRTUALENV_INIT 1;
|
set -gx PYENV_VIRTUALENV_INIT 1;
|
||||||
EOS
|
EOS
|
||||||
|
|||||||
Reference in New Issue
Block a user