Skip to content

Commit

Permalink
[common] Remove VIRTUAL_ENV and PATH
Browse files Browse the repository at this point in the history
  • Loading branch information
goldyfruit committed Nov 18, 2023
1 parent 1ca8e49 commit 8a661d0
Showing 1 changed file with 3 additions and 9 deletions.
12 changes: 3 additions & 9 deletions utils/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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]"
}
Expand Down

0 comments on commit 8a661d0

Please sign in to comment.