From 131e44afcbe7ea09ae9f4e3f460ae8f19574507f Mon Sep 17 00:00:00 2001 From: Ivan Pozdeev Date: Tue, 16 Feb 2021 23:59:08 +0300 Subject: [PATCH] Remove the "Using script's directory as PYENV_DIR if shim is invoked with a script argument" feature It's impossible to 100% reliably extract the script argument from the command line for all and unknown Python versions and implementations --- libexec/pyenv-rehash | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/libexec/pyenv-rehash b/libexec/pyenv-rehash index 094d6173..5fcb6646 100755 --- a/libexec/pyenv-rehash +++ b/libexec/pyenv-rehash @@ -67,19 +67,6 @@ set -e [ -n "\$PYENV_DEBUG" ] && set -x program="\${0##*/}" -if [[ "\$program" = "python"* ]]; then - for arg; do - case "\$arg" in - -c* | -- ) break ;; - */* ) - if [ -f "\$arg" ]; then - export PYENV_DIR="\${arg%/*}" - break - fi - ;; - esac - done -fi export PYENV_ROOT="$PYENV_ROOT" exec "$(command -v pyenv)" exec "\$program" "\$@"