Unverified Commit 5377cc37 authored by Marc Cornellà's avatar Marc Cornellà
Browse files

fix(pyenv): fix for ignoring pyenv-win commands

The previous fix ignored any pyenv command found in $PATH while on
WSL, regardless of whether it was correctly set up or not.

This change only ignores the pyenv command if it's proved to come
from pyenv-win by looking at its full path.
parent c8a25869
# This plugin loads pyenv into the current shell and provides prompt info via # This plugin loads pyenv into the current shell and provides prompt info via
# the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available. # the 'pyenv_prompt_info' function. Also loads pyenv-virtualenv if available.
# Load pyenv only if command not already available # Look for pyenv in $PATH and verify that it's not a part of pyenv-win in WSL
if command -v pyenv &> /dev/null && [[ "$(uname -r)" != *icrosoft* ]]; then if ! command -v pyenv &>/dev/null; then
FOUND_PYENV=1 FOUND_PYENV=0
else elif [[ "${commands[pyenv]}" = */pyenv-win/* && "$(uname -r)" = *icrosoft* ]]; then
FOUND_PYENV=0 FOUND_PYENV=0
else
FOUND_PYENV=1
fi fi
# Look for pyenv and try to load it (will only work on interactive shells) # Look for pyenv and try to load it (will only work on interactive shells)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment