1
mirror of https://github.com/home-assistant/core synced 2024-09-28 03:04:04 +02:00
ha-core/script/run-in-env.sh
Ville Skyttä 63403f894d
Fix run-in-env.sh sh options (#38520)
Shebang takes only one arg, regression in
f6540e3002
2020-08-03 21:20:12 +02:00

22 lines
448 B
Bash
Executable File

#!/usr/bin/env sh
set -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
my_path=$(git rev-parse --show-toplevel)
for venv in venv .venv .; do
if [ -f "${my_path}/${venv}/bin/activate" ]; then
. "${my_path}/${venv}/bin/activate"
fi
done
exec "$@"