diff --git a/scripts/run.sh b/scripts/run.sh index 1f93f9f..50491e7 100755 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -23,15 +23,23 @@ echo "Python venv module found." # --- Backend Setup --- echo "Setting up backend..." cd backend +echo "--> Changed directory to $(pwd)" -# Create a virtual environment if it doesn't exist -if [ ! -d ".venv" ]; then - echo "Creating virtual environment..." +# Create a virtual environment if it doesn't exist or is invalid +echo "--> Checking for .venv/bin/activate..." +if [ ! -f ".venv/bin/activate" ]; then + echo "--> .venv/bin/activate NOT found. Recreating virtual environment..." + rm -rf .venv python3 -m venv .venv + echo "--> Virtual environment created." +else + echo "--> .venv/bin/activate found. Skipping creation." fi # Activate virtual environment and install dependencies +echo "--> Activating virtual environment..." source .venv/bin/activate +echo "--> Virtual environment activated." pip install -r requirements.txt deactivate