From 6f9e62e7b76e55354e783d1a026bffc756988ae5 Mon Sep 17 00:00:00 2001 From: classabbyamp Date: Fri, 17 May 2024 12:16:27 -0400 Subject: [PATCH] run.sh: respect $VIRTUAL_ENV --- CHANGELOG.md | 1 + run.sh | 9 +++------ 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index da08249..81455ef 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.5.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..bbe33ef 100644 --- a/run.sh +++ b/run.sh @@ -8,11 +8,8 @@ # https://github.com/0x5c/quick-bot-no-pain -# If $BOTENV is not defined, default to 'botenv' -if [ -z "$BOTENV" ]; then - BOTENV='botenv' -fi - +: "${BOTENV:=./botenv}" +: "${VIRTUAL_ENV:="$BOTENV"}" # Argument handling _PASS_ERRORS=0 @@ -71,7 +68,7 @@ while true; do if [ $_NO_BOTENV -eq 1 ]; then "$PYTHON_BIN" main.py "$@" else - "./$BOTENV/bin/python3" main.py "$@" + "$VIRTUAL_ENV/bin/python3" main.py "$@" fi err=$? _message="$0: The bot exited with [$err]"