fix: add python -m pip
command to pip hook-script.
When doing `pip install ...`, the command is redirected to `pyenv.d/exec/pip-rehash/pip`, which does a `pyenv rehash` after installation. A simple fix to issue #3031 is to make `python -m pip` commands go through the same special hook script.
This commit is contained in:
parent
4c6b0e9c3b
commit
c660839b62
@ -6,6 +6,10 @@ if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.\d)?$ ]]; then
|
|||||||
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
|
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [[ $1 == "python" && $2 == "-m" && $3 == "pip" ]]; then
|
||||||
|
PYENV_REHASH_COMMAND="pip"
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then
|
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then
|
||||||
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND##*/}"
|
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND##*/}"
|
||||||
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
|
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user