#!/bin/bash # 初始化数据库脚本 cd "$(dirname "$0")" # 检查虚拟环境 if [ -d ".venv" ]; then source .venv/bin/activate python init_data.py else echo "Virtual environment not found. Please run: python3 -m venv .venv" echo "Then install dependencies: pip install -r requirements.txt" exit 1 fi