diff --git a/CHANGELOG.md b/CHANGELOG.md index 1f085e4..e0a2066 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ## [Unreleased] ### Changed - Updated Pycord to 2.6.0. +- `run.sh` to respect the `VIRTUAL_ENV` environment variable. ## [2.9.2] - 2023-12-15 diff --git a/run.sh b/run.sh index c31bcbd..1e2d3e6 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]"