17 lines
No EOL
536 B
Bash
17 lines
No EOL
536 B
Bash
VENV_DIR="$SCRIPT_DIR/.venv"
|
|
|
|
setup_venv() {
|
|
if [[ ! -d "$VENV_DIR" ]]; then
|
|
python3 -m venv "$VENV_DIR" >/dev/null 2>&1
|
|
"$VENV_DIR/bin/pip" install --upgrade pip >/dev/null 2>&1
|
|
"$VENV_DIR/bin/pip" install pillow screeninfo >/dev/null 2>&1
|
|
|
|
PYTHON_EXEC="$VENV_DIR/bin/python3"
|
|
if [[ ! -f "$PYTHON_EXEC" ]]; then
|
|
echo -e "${RED}Python executable not found in virtual environment.${RESET}"
|
|
exit 1
|
|
fi
|
|
else
|
|
PYTHON_EXEC="$VENV_DIR/bin/python3"
|
|
fi
|
|
} |