34 lines
959 B
PowerShell
34 lines
959 B
PowerShell
#!/usr/bin/env pwsh
|
|||
|
|
|
||
|
|
$ErrorActionPreference = "Stop"
|
||
|
|
Set-Location -Path $PSScriptRoot
|
||
|
|
|
||
|
|
# T-001 接入真实工程后替换。未配置时主动失败,防止把占位命令当成有效基线。
|
||
|
|
$InstallCmd = "__REPLACE_AFTER_T001__"
|
||
|
|
$VerifyCmd = "__REPLACE_AFTER_T001__"
|
||
|
|
$StartCmd = "__REPLACE_AFTER_T001__"
|
||
|
|
|
||
|
|
foreach ($entry in @{
|
||
|
|
InstallCmd = $InstallCmd
|
||
|
|
VerifyCmd = $VerifyCmd
|
||
|
|
StartCmd = $StartCmd
|
||
|
|
}.GetEnumerator()) {
|
||
|
|
if ($entry.Value -like "__REPLACE_*") {
|
||
|
|
[Console]::Error.WriteLine(
|
||
|
|
"项目尚未完成 T-001;请配置 $($entry.Key),并同步 docs/03-tech-stack.md 和 docs/current-state.md。"
|
||
|
|
)
|
||
|
|
exit 2
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
Write-Host "==> 当前目录: $($PWD.Path)"
|
||
|
|
Write-Host "==> 同步依赖"
|
||
|
|
Invoke-Expression $InstallCmd
|
||
|
|
Write-Host "==> 运行基础验证"
|
||
|
|
Invoke-Expression $VerifyCmd
|
||
|
|
Write-Host "==> 启动命令: $StartCmd"
|
||
|
|
|
||
|
|
if ($env:RUN_START_COMMAND -eq "1") {
|
||
|
|
Invoke-Expression $StartCmd
|
||
|
|
}
|