mirror of
https://github.com/home-assistant/core.git
synced 2025-07-29 18:28:14 +02:00
Run mypy through a pyenv/virtualenv enabler wrapper script (#30922)
This commit is contained in:
18
script/run-in-env.sh
Executable file
18
script/run-in-env.sh
Executable file
@ -0,0 +1,18 @@
|
||||
#!/bin/sh -eu
|
||||
|
||||
# Activate pyenv and virtualenv if present, then run the specified command
|
||||
|
||||
# pyenv, pyenv-virtualenv
|
||||
if [ -s .python-version ]; then
|
||||
PYENV_VERSION=$(head -n 1 .python-version)
|
||||
export PYENV_VERSION
|
||||
fi
|
||||
|
||||
# other common virtualenvs
|
||||
for venv in venv .venv .; do
|
||||
if [ -f $venv/bin/activate ]; then
|
||||
. $venv/bin/activate
|
||||
fi
|
||||
done
|
||||
|
||||
exec "$@"
|
Reference in New Issue
Block a user