/
/
/
1#!/usr/bin/env sh
2set -eu
3
4# Activate pyenv and virtualenv if present, then run the specified command
5
6# pyenv, pyenv-virtualenv
7if [ -s .python-version ]; then
8 PYENV_VERSION=$(head -n 1 .python-version)
9 export PYENV_VERSION
10fi
11
12# other common virtualenvs
13my_path=$(git rev-parse --show-toplevel)
14
15for venv in venv .venv .; do
16 if [ -f "${my_path}/${venv}/bin/activate" ]; then
17 . "${my_path}/${venv}/bin/activate"
18 break
19 fi
20done
21
22exec "$@"
23