docs(project): align product names and source directories
This commit is contained in:
@@ -4,8 +4,9 @@
|
||||
# - Windows 原生 PowerShell:./init.ps1
|
||||
# - WSL / Git Bash:./init.sh
|
||||
#
|
||||
# 本项目是双端结构:web/(Go)+ desk/(Python)。脚本按目录是否存在分别处理,
|
||||
# 未初始化的一端会跳过并提示对应任务,不会静默通过。
|
||||
# 本项目是双产品结构:admin/(采购服务,Go)+ client/(采购工具,Python)。脚本按
|
||||
# admin/go.mod 与 client/requirements.txt 两个初始化哨兵分别处理;未初始化的一端会跳过并
|
||||
# 提示对应任务,不会把空目录误判为可运行项目,也不会静默通过。
|
||||
#
|
||||
# T-001 / T-002 / T-003 落地后,把下面的命令补全,并同步:
|
||||
# docs/03-tech-stack.md、docs/00-ai-start-here.md、docs/current-state.md
|
||||
@@ -16,49 +17,49 @@ Set-Location -Path $PSScriptRoot
|
||||
# Go 工具链固定用本机版本,避免自动下载
|
||||
$env:GOTOOLCHAIN = "local"
|
||||
|
||||
$WebDir = Join-Path $PSScriptRoot "web"
|
||||
$DeskDir = Join-Path $PSScriptRoot "desk"
|
||||
$AdminDir = Join-Path $PSScriptRoot "admin"
|
||||
$ClientDir = Join-Path $PSScriptRoot "client"
|
||||
$Pending = @()
|
||||
|
||||
Write-Host "==> 当前目录: $($PWD.Path)"
|
||||
|
||||
# ---------------------------------------------------------------- web 端(Go)
|
||||
if (Test-Path $WebDir) {
|
||||
Write-Host "==> web 端:同步依赖"
|
||||
Push-Location $WebDir
|
||||
# ------------------------------------------------------- 采购服务(admin/,Go)
|
||||
if (Test-Path (Join-Path $AdminDir "go.mod") -PathType Leaf) {
|
||||
Write-Host "==> 采购服务:admin/ 同步依赖"
|
||||
Push-Location $AdminDir
|
||||
try {
|
||||
go mod download
|
||||
Write-Host "==> web 端:静态检查"
|
||||
Write-Host "==> 采购服务:admin/ 静态检查"
|
||||
go vet ./...
|
||||
Write-Host "==> web 端:测试"
|
||||
Write-Host "==> 采购服务:admin/ 测试"
|
||||
go test ./...
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
} else {
|
||||
Write-Host "==> web 端:目录 web/ 不存在,跳过。先做 T-001(初始化 web 端 Go 骨架)。"
|
||||
$Pending += "T-001 初始化 web 端 Go 骨架"
|
||||
Write-Host "==> 采购服务:admin/go.mod 不存在,跳过。先做 T-001(初始化 admin/ Go 骨架)。"
|
||||
$Pending += "T-001 初始化采购服务 admin/ Go 骨架"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------ desk 端(Python)
|
||||
if (Test-Path $DeskDir) {
|
||||
Write-Host "==> desk 端:同步依赖"
|
||||
Push-Location $DeskDir
|
||||
# ---------------------------------------------------- 采购工具(client/,Python)
|
||||
if (Test-Path (Join-Path $ClientDir "requirements.txt") -PathType Leaf) {
|
||||
Write-Host "==> 采购工具:client/ 同步依赖"
|
||||
Push-Location $ClientDir
|
||||
try {
|
||||
if (-not (Test-Path ".venv")) {
|
||||
python -m venv .venv
|
||||
}
|
||||
& ".venv\Scripts\python.exe" -m pip install -q -r requirements.txt
|
||||
Write-Host "==> desk 端:语法检查"
|
||||
Write-Host "==> 采购工具:client/ 语法检查"
|
||||
& ".venv\Scripts\python.exe" -m compileall -q src tests
|
||||
Write-Host "==> desk 端:测试"
|
||||
Write-Host "==> 采购工具:client/ 测试"
|
||||
& ".venv\Scripts\python.exe" -m unittest discover -s tests -t .
|
||||
} finally {
|
||||
Pop-Location
|
||||
}
|
||||
} else {
|
||||
Write-Host "==> desk 端:目录 desk/ 不存在,跳过。先做 T-002(初始化 desk 端 Python 骨架)。"
|
||||
$Pending += "T-002 初始化 desk 端 Python 骨架"
|
||||
Write-Host "==> 采购工具:client/requirements.txt 不存在,跳过。先做 T-002(初始化 client/ Python 骨架)。"
|
||||
$Pending += "T-002 初始化采购工具 client/ Python 骨架"
|
||||
}
|
||||
|
||||
# ------------------------------------------------------------------ 文档自检
|
||||
@@ -76,8 +77,8 @@ if ($Pending.Count -gt 0) {
|
||||
}
|
||||
|
||||
Write-Host "==> 启动命令"
|
||||
Write-Host " web 端: cd web ; go run ./cmd/server"
|
||||
Write-Host " desk 端: cd desk ; .venv\Scripts\python.exe src/main.py"
|
||||
Write-Host " 采购服务:cd admin ; go run ./cmd/server"
|
||||
Write-Host " 采购工具:cd client ; .venv\Scripts\python.exe src/main.py"
|
||||
Write-Host ""
|
||||
Write-Host "基础验证失败时先修基线,不要在坏的起点上继续叠新功能。"
|
||||
Write-Host "真机连接与设备验收只能由人工完成,agent 不得据此把任务标为 DONE。"
|
||||
|
||||
Reference in New Issue
Block a user