chore: 开发脚本自动进入虚拟环境

This commit is contained in:
Nixevol
2026-07-13 16:28:08 +08:00
parent 182f0e5612
commit 3c74f03e7e
4 changed files with 57 additions and 10 deletions
+2 -4
View File
@@ -40,17 +40,15 @@ artveris/
### 一键脚本(推荐)
```bash
python -m venv .venv
.\.venv\Scripts\activate # Windows;macOS/Linux 为 source .venv/bin/activate
python -m pip install -r scripts/requirements.txt
python scripts/dev.py --install # 首次:安装依赖 + 启动三端
python scripts/dev.py # 日常启动
```
- `dev.py` 会先检查当前是否已在虚拟环境中;若没有,会自动复用项目根目录的 `.venv`/`venv`,不存在则创建 `.venv` 并安装 `scripts/requirements.txt`,随后用虚拟环境 Python 重新执行脚本。
- **全新检出(无 `.env`)**:自动进入安装向导,浏览器打开 `http://localhost:5173` 按页面提示填写 MySQL/Redis 与管理员账号,提交后自动建库、迁移、初始化并写入根 `.env`,随后转入正常开发模式。
- **已有 `.env`**:直接构建共享包、同步数据库并启动三端。加 `--no-seed` 跳过种子数据,`--stop` 停止全部进程。
若 PowerShell 阻止激活虚拟环境,先执行 `Set-ExecutionPolicy -Scope Process -ExecutionPolicy Bypass`。更多细节见 `scripts/README.md`。
更多细节见 `scripts/README.md`。
### 手动命令