From 140808e3d407bfd24096acef16e9052431459186 Mon Sep 17 00:00:00 2001 From: Tanix Date: Thu, 12 Dec 2013 20:59:34 +0900 Subject: [PATCH 1/2] Fix pyenv-prefix to trim "/bin" in `pyenv prefix system` --- libexec/pyenv-prefix | 1 + 1 file changed, 1 insertion(+) diff --git a/libexec/pyenv-prefix b/libexec/pyenv-prefix index f305b626..882390e1 100755 --- a/libexec/pyenv-prefix +++ b/libexec/pyenv-prefix @@ -32,6 +32,7 @@ for version in "${versions[@]}"; do if [ "$version" = "system" ]; then PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python || true)" PYENV_PREFIX_PATH="${PYTHON_PATH%/*}" + PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH%/bin}" else PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}" fi From fd3dd225ba320f27a8bf6b603856ad88c67c0e6c Mon Sep 17 00:00:00 2001 From: Tanix Date: Thu, 12 Dec 2013 23:04:22 +0900 Subject: [PATCH 2/2] rewrite strip of PYENV_PREFIX_PATH in a single line --- libexec/pyenv-prefix | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libexec/pyenv-prefix b/libexec/pyenv-prefix index 882390e1..64f6f391 100755 --- a/libexec/pyenv-prefix +++ b/libexec/pyenv-prefix @@ -31,8 +31,7 @@ PYENV_PREFIX_PATHS=() for version in "${versions[@]}"; do if [ "$version" = "system" ]; then PYTHON_PATH="$(PYENV_VERSION="${version}" pyenv-which python || true)" - PYENV_PREFIX_PATH="${PYTHON_PATH%/*}" - PYENV_PREFIX_PATH="${PYENV_PREFIX_PATH%/bin}" + PYENV_PREFIX_PATH="${PYTHON_PATH%/bin/*}" else PYENV_PREFIX_PATH="${PYENV_ROOT}/versions/${version}" fi