From 2bb20a029bbfb77fcc2099e65be0e96a96108a32 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Wed, 26 Mar 2014 15:13:26 +0900 Subject: [PATCH] remove `pyenv-pip-rehash/libexec` from `PATH` to avoid infinite loops in `pyenv-which` (yyuu/pyenv#146) --- libexec/easy_install | 8 ++++++++ libexec/pip | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/libexec/easy_install b/libexec/easy_install index 7a6ceb3..d0b080b 100755 --- a/libexec/easy_install +++ b/libexec/easy_install @@ -3,6 +3,14 @@ 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%/*}" diff --git a/libexec/pip b/libexec/pip index 9608d18..f4e7ce7 100755 --- a/libexec/pip +++ b/libexec/pip @@ -3,6 +3,14 @@ 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%/*}"