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
This commit is contained in:
Ivan Pozdeev 2021-02-16 23:59:08 +03:00
parent a6b0a2846e
commit 131e44afcb

View file

@ -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" "\$@"