run.sh: respect $VIRTUAL_ENV

This commit is contained in:
classabbyamp 2024-05-17 12:16:27 -04:00
parent 9db042c09d
commit fbe64df14d
No known key found for this signature in database
GPG Key ID: 6BE0755918A4C7F5
2 changed files with 7 additions and 4 deletions

View File

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

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