From 155a829e585b4ad4f8a6ff710854727a3e651426 Mon Sep 17 00:00:00 2001 From: Rune Morling Date: Sat, 29 Jun 2024 12:14:43 +0200 Subject: [PATCH] venv: BRANCH variable can be used as an override This should make the testing of PRs before landing them more viable. Signed-off-by: Rune Morling --- eopkg_venv_functions.bash | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/eopkg_venv_functions.bash b/eopkg_venv_functions.bash index cf6bd3b..abc49b7 100644 --- a/eopkg_venv_functions.bash +++ b/eopkg_venv_functions.bash @@ -6,6 +6,9 @@ set -euo pipefail source shared_functions.bash +# allow user to override branch name +EOPKG_BRANCH="${BRANCH:-main}" + function prepare_venv () { if [[ -z "${PY3}" ]]; then die "Couldn't find supported python3 (3.11 || 3.12 || 3.10) interpreter, exiting!" @@ -15,7 +18,7 @@ function prepare_venv () { # Assume the user starts in the eopkg dir printInfo "Updating the eopkg git repo ..." # ensure we show the current branch - git fetch && git checkout main && git pull && git branch + git fetch && git checkout "${EOPKG_BRANCH}" && git pull && git branch printInfo "Set up a clean eopkg_venv venv ..." ${PY3} -m venv --system-site-packages --clear eopkg_venv