From 2e58691093afa05a74d7bff23395b4d4751cd87d Mon Sep 17 00:00:00 2001 From: Andrew Ferrazzutti Date: Fri, 7 Feb 2025 11:36:10 -0500 Subject: [PATCH] run_in_venv: skip unnecessary env reinstallation --- .../restricted-guests/synapse/scripts/run_in_venv.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/restricted-guests/synapse/scripts/run_in_venv.sh b/modules/restricted-guests/synapse/scripts/run_in_venv.sh index 1125d3f238..21e676f0c0 100755 --- a/modules/restricted-guests/synapse/scripts/run_in_venv.sh +++ b/modules/restricted-guests/synapse/scripts/run_in_venv.sh @@ -28,9 +28,9 @@ cd -- "$(dirname -- "$0")/.." repo_root=$(git rev-parse --show-cdup) venv_path=${repo_root:-./}.venv -[ -d "$venv_path" ] || python${PYTHON_VERSION:-3} -m venv "$venv_path" -. "$venv_path/bin/activate" +if [ ! -d "$venv_path" ]; then + "python${PYTHON_VERSION:-3}" -m venv "$venv_path" + "$venv_path/bin/pip" install -e ."[dev]" +fi -pip install -e ."[dev]" - -[ $# -gt 1 ] && "$@" +[ $# -gt 1 ] && . "$venv_path/bin/activate" && "$@"