chore: apply phase 0 review fixes
This commit is contained in:
@@ -33,6 +33,22 @@ Assert-Configured -Name "StartCmd" -Value $StartCmd
|
||||
|
||||
Write-Host "==> 当前目录: $($PWD.Path)"
|
||||
|
||||
Write-Host "==> 校验 Python 版本"
|
||||
$PythonVersion = py -3.12 -c "import sys; print(f'{sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}')"
|
||||
if ($LASTEXITCODE -ne 0) {
|
||||
Write-Error "无法运行 py -3.12。请安装 Python 3.12/3.13,并确保 py launcher 可用。"
|
||||
exit 3
|
||||
}
|
||||
|
||||
$VersionParts = $PythonVersion.Trim().Split(".")
|
||||
$MajorVersion = [int]$VersionParts[0]
|
||||
$MinorVersion = [int]$VersionParts[1]
|
||||
if ($MajorVersion -ne 3 -or $MinorVersion -lt 12 -or $MinorVersion -ge 14) {
|
||||
Write-Error "Python 版本必须满足 >=3.12,<3.14,当前为 $PythonVersion。"
|
||||
exit 3
|
||||
}
|
||||
Write-Host " Python $PythonVersion"
|
||||
|
||||
if (-not (Test-Path "manage.py")) {
|
||||
Write-Error "未找到 manage.py。Django 骨架尚未初始化(见 docs/06-tasks.md 的 T-001)。完成 T-001 后本脚本即可正常运行。"
|
||||
exit 1
|
||||
|
||||
Reference in New Issue
Block a user