chore(run.sh): add detailed logging for venv setup

This commit is contained in:
xucheng 2025-10-30 15:29:04 +08:00
parent 194a4d4377
commit 7d42abea78

View File

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