mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-07 20:31:01 -05:00
Merge pull request #368 from blueyed/pip-rehash-for-versions
pip-rehash: handle versions in commands, like "pip2" and "pip3.4"
This commit is contained in:
commit
70cce28ba3
3 changed files with 13 additions and 5 deletions
|
@ -1,5 +1,13 @@
|
|||
PYENV_PIP_REHASH_ROOT="${BASH_SOURCE[0]%/*}/pip-rehash"
|
||||
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_COMMAND##*/}" ]; then
|
||||
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_COMMAND##*/}"
|
||||
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
|
||||
PYENV_REHASH_COMMAND="${PYENV_COMMAND##*/}"
|
||||
|
||||
# Remove any version information, from e.g. "pip2" or "pip3.4".
|
||||
if [[ $PYENV_REHASH_COMMAND =~ ^(pip|easy_install)[23](\.\d)?$ ]]; then
|
||||
PYENV_REHASH_COMMAND="${BASH_REMATCH[1]}"
|
||||
fi
|
||||
|
||||
if [ -x "${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND}" ]; then
|
||||
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/${PYENV_REHASH_COMMAND##*/}"
|
||||
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}"
|
||||
export PYENV_REHASH_REAL_COMMAND="${PYENV_COMMAND##*/}"
|
||||
fi
|
||||
|
|
|
@ -11,7 +11,7 @@ _PATH="${_PATH#:}"
|
|||
_PATH="${_PATH%:}"
|
||||
PATH="${_PATH}"
|
||||
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "${PYENV_REHASH_REAL_COMMAND}")"
|
||||
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
||||
|
||||
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
||||
|
|
|
@ -11,7 +11,7 @@ _PATH="${_PATH#:}"
|
|||
_PATH="${_PATH%:}"
|
||||
PATH="${_PATH}"
|
||||
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "${PYENV_REHASH_REAL_COMMAND}")"
|
||||
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
||||
|
||||
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
||||
|
|
Loading…
Reference in a new issue