From 926489ae3a624c97f1c2228ea2508a15e8e361bc Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Mon, 9 Feb 2026 22:11:01 -0500 Subject: [PATCH] run.sh: respect VIRTUAL_ENV --- CHANGELOG.md | 1 + run.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fc7d857..5412309 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). - Support for Python 3.14. ### Changed - Updated Pycord to 2.7.1. +- `run.sh` to respect the `VIRTUAL_ENV` environment variable. ## [2.9.2] - 2023-12-15 diff --git a/run.sh b/run.sh index d2337ec..b6a1ff2 100644 --- a/run.sh +++ b/run.sh @@ -8,11 +8,13 @@ # https://github.com/0x5c/quick-bot-no-pain -# If $BOTENV is not defined, default to 'botenv' -if [ -z "$BOTENV" ]; then - BOTENV='botenv' +if [ -n "$VIRTUAL_ENV" ]; then + BOTENV="$VIRTUAL_ENV" fi +if [ -z "$BOTENV" ]; then + BOTENV='./botenv' +fi # Argument handling _PASS_ERRORS=0 @@ -71,7 +73,7 @@ while true; do if [ $_NO_BOTENV -eq 1 ]; then "$PYTHON_BIN" main.py "$@" else - "./$BOTENV/bin/python3" main.py "$@" + "$BOTENV/bin/python3" main.py "$@" fi err=$? _message="$0: The bot exited with [$err]"