mirror of
https://github.com/pyenv/pyenv.git
synced 2024-11-21 20:47:00 -05:00
Add pip-rehash
This commit is contained in:
parent
5ca423c9f3
commit
acce3744e7
3 changed files with 61 additions and 0 deletions
5
pyenv.d/exec/pip-rehash.bash
Normal file
5
pyenv.d/exec/pip-rehash.bash
Normal file
|
@ -0,0 +1,5 @@
|
|||
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}"
|
||||
fi
|
27
pyenv.d/exec/pip-rehash/easy_install
Executable file
27
pyenv.d/exec/pip-rehash/easy_install
Executable file
|
@ -0,0 +1,27 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
# Remove pyenv-pip-rehash/libexec from PATH to avoid infinite loops in `pyenv-which` (yyuu/pyenv#146)
|
||||
_PATH=":${PATH}:"
|
||||
_HERE="$(dirname "${BASH_SOURCE[0]}")" # remove this from PATH
|
||||
_PATH="${_PATH//:${_HERE}:/:}"
|
||||
_PATH="${_PATH#:}"
|
||||
_PATH="${_PATH%:}"
|
||||
PATH="${_PATH}"
|
||||
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
|
||||
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
||||
|
||||
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
||||
|
||||
STATUS=0
|
||||
"$PYENV_COMMAND_PATH" "$@" || STATUS="$?"
|
||||
|
||||
# Run `pyenv-rehash` after a successful installation.
|
||||
if [ "$STATUS" == "0" ]; then
|
||||
pyenv-rehash
|
||||
fi
|
||||
|
||||
exit "$STATUS"
|
29
pyenv.d/exec/pip-rehash/pip
Executable file
29
pyenv.d/exec/pip-rehash/pip
Executable file
|
@ -0,0 +1,29 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
[ -n "$PYENV_DEBUG" ] && set -x
|
||||
|
||||
# Remove pyenv-pip-rehash/libexec from PATH to avoid infinite loops in `pyenv-which` (yyuu/pyenv#146)
|
||||
_PATH=":${PATH}:"
|
||||
_HERE="$(dirname "${BASH_SOURCE[0]}")" # remove this from PATH
|
||||
_PATH="${_PATH//:${_HERE}:/:}"
|
||||
_PATH="${_PATH#:}"
|
||||
_PATH="${_PATH%:}"
|
||||
PATH="${_PATH}"
|
||||
|
||||
PYENV_COMMAND_PATH="$(pyenv-which "$(basename "$0")")"
|
||||
PYENV_BIN_PATH="${PYENV_COMMAND_PATH%/*}"
|
||||
|
||||
export PATH="${PYENV_BIN_PATH}:${PATH}"
|
||||
|
||||
STATUS=0
|
||||
"$PYENV_COMMAND_PATH" "$@" || STATUS="$?"
|
||||
|
||||
# Run `pyenv-rehash` after a successful installation.
|
||||
if [ "$STATUS" == "0" ]; then
|
||||
case "$1" in
|
||||
"install" | "uninstall" ) pyenv-rehash;;
|
||||
esac
|
||||
fi
|
||||
|
||||
exit "$STATUS"
|
Loading…
Reference in a new issue