-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
62934ed
commit 2ca770d
Showing
2 changed files
with
28 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env sh | ||
# From https://github.com/home-assistant/core/blob/dev/script/run-in-env.sh | ||
set -eu | ||
|
||
# Used in venv activate script. | ||
# Would be an error if undefined. | ||
OSTYPE="${OSTYPE-}" | ||
|
||
# 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" | ||
break | ||
fi | ||
done | ||
|
||
exec "$@" |