2012-08-31 02:23:41 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
#
|
|
|
|
# `python-local-exec` is a drop-in replacement for the standard Python
|
|
|
|
# shebang line:
|
|
|
|
#
|
|
|
|
# #!/usr/bin/env python-local-exec
|
|
|
|
#
|
|
|
|
# Use it for scripts inside a project with an `.pyenv-version`
|
|
|
|
# file. When you run the scripts, they'll use the project-specified
|
|
|
|
# Python version, regardless of what directory they're run from. Useful
|
|
|
|
# for e.g. running project tasks in cron scripts without needing to
|
|
|
|
# `cd` into the project first.
|
|
|
|
|
|
|
|
set -e
|
|
|
|
export PYENV_DIR="${1%/*}"
|
2013-01-18 04:57:08 -05:00
|
|
|
|
|
|
|
[ -n "$PYENV_SILENCE_WARNINGS" ] || {
|
|
|
|
echo "pyenv: \`python-local-exec' is deprecated and will be removed in the next release."
|
|
|
|
echo " To upgrade: https://github.com/yyuu/pyenv/wiki/python-local-exec"
|
|
|
|
echo
|
|
|
|
} >&2
|
|
|
|
|
2012-08-31 02:23:41 -04:00
|
|
|
exec python "$@"
|