run.sh: respect VIRTUAL_ENV

This commit is contained in:
classabbyamp 2026-02-09 22:11:01 -05:00 committed by classabbyamp
parent 8e4f8b3fe0
commit 926489ae3a
2 changed files with 7 additions and 4 deletions

View File

@ -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

10
run.sh
View File

@ -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]"