1
mirror of https://github.com/home-assistant/core synced 2024-09-15 17:29:45 +02:00
ha-core/script/run-in-env.sh
Tom Harris f6540e3002
Fix pre-commit hook issue on Windows (#31648)
* Make shebang compatable with Windows

* Prehook test

* Undo prehook test
2020-02-18 13:33:52 -08:00

19 lines
380 B
Bash
Executable File

#!/usr/bin/env 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 "$@"