diff --git a/hack/build/activate-env.sh b/hack/build/activate-env.sh new file mode 100755 index 0000000..0eb8c04 --- /dev/null +++ b/hack/build/activate-env.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +PREVIOUS_CWD="${PWD}" +REAL_SCRIPT="$(realpath "${0}")" +cd "$(dirname "${REAL_SCRIPT}")/../.." || return +unset REAL_SCRIPT + +activate_env() { + if [ ! -d "venv" ]; then + python3 -m venv venv + pip install --upgrade pip + fi + . venv/bin/activate + pip3 install -qq -r requirements.txt +} + +activate_env +unset -f activate_env +cd "${PREVIOUS_CWD}" || return +unset PREVIOUS_CWD