Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Commit

Permalink
Run rehash after easy_install
Browse files Browse the repository at this point in the history
  • Loading branch information
Yamashita Yuu committed Jan 20, 2014
1 parent 87b3b6c commit e4aeb30
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 2 deletions.
4 changes: 2 additions & 2 deletions etc/pyenv.d/exec/pip.bash
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ abs_dirname() {

PYENV_PIP_REHASH_ROOT="$(abs_dirname "${BASH_SOURCE[0]}")/../../.."

if [[ "${PYENV_COMMAND##*/}" == "pip" ]]; then
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/libexec/pip"
if [ -x "${PYENV_PIP_REHASH_ROOT}/libexec/${PYENV_COMMAND##*/}" ]; then
PYENV_COMMAND_PATH="${PYENV_PIP_REHASH_ROOT}/libexec/${PYENV_COMMAND##*/}"
PYENV_BIN_PATH="${PYENV_PIP_REHASH_ROOT}/libexec"
fi
19 changes: 19 additions & 0 deletions libexec/easy_install
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

set -e
[ -n "$PYENV_DEBUG" ] && set -x

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"

0 comments on commit e4aeb30

Please sign in to comment.