shims: look for python*

This is required for the shims to handle `#!/usr/bin/env python3` in a
shebang, just like `python` is handled currently: it will set
`PYENV_DIR` to the root of the invoked script, which is required for a
`.python-version` script to get picked up from there.

This was rejected for rbenv, where it does not make much sense
(https://github.com/sstephenson/rbenv/pull/735).

Ref: https://github.com/yyuu/pyenv/pull/368#issuecomment-102806837
This commit is contained in:
Daniel Hahler 2015-05-18 16:34:02 +02:00
parent 36c5cbf74f
commit af438abeae

View file

@ -46,7 +46,7 @@ set -e
[ -n "\$PYENV_DEBUG" ] && set -x [ -n "\$PYENV_DEBUG" ] && set -x
program="\${0##*/}" program="\${0##*/}"
if [ "\$program" = "python" ]; then if [[ "\$program" = "python"* ]]; then
for arg; do for arg; do
case "\$arg" in case "\$arg" in
-c* | -- ) break ;; -c* | -- ) break ;;