Skip to content

Commit

Permalink
add hack/build/activate-env.sh to simplify dev environment
Browse files Browse the repository at this point in the history
  • Loading branch information
azenla committed Nov 18, 2024
1 parent b58415f commit 9f63f4d
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions hack/build/activate-env.sh
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 9f63f4d

Please sign in to comment.