From 8a661d0833b41eadabb2bafe91b71e82595bf7f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Trellu?= Date: Sat, 18 Nov 2023 18:59:08 -0500 Subject: [PATCH] [common] Remove VIRTUAL_ENV and PATH --- utils/common.sh | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/utils/common.sh b/utils/common.sh index c3603fae..c812fff0 100644 --- a/utils/common.sh +++ b/utils/common.sh @@ -186,9 +186,9 @@ function required_packages() { echo -e "[$done_format]" } -# Create Python virtual environment and add the information to the user's -# .bashrc in order to provide the PATH and enable the virtualenv when the -# user logs in. +# Create Python virtual environment and update pip package. +# Permissions on the virtual environment are set to match the +# target user. function create_python_venv() { echo -ne "➤ Creating Python virtualenv... " python3 -m venv "$VENV_PATH" &>>"$LOG_FILE" @@ -197,12 +197,6 @@ function create_python_venv() { source "$VENV_PATH/bin/activate" pip3 install --upgrade pip &>>"$LOG_FILE" - if ! grep -q "^VIRTUAL_ENV=$VENV_PATH" "$RUN_AS_HOME/.bashrc" &>>"$LOG_FILE"; then - echo "VIRTUAL_ENV=$VENV_PATH" >>"$RUN_AS_HOME/.bashrc" - fi - if ! grep -q "^PATH=" "$RUN_AS_HOME/.bashrc" &>>"$LOG_FILE"; then - echo "PATH=$PATH:$VENV_PATH/bin" >>"$RUN_AS_HOME/.bashrc" - fi chown "$RUN_AS":"$RUN_AS" "$RUN_AS_HOME"/.venvs echo -e "[$done_format]" }