25 lines
1.1 KiB
PowerShell
25 lines
1.1 KiB
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
$ScriptPath = Join-Path $PSScriptRoot "open-readest-latest.ps1"
|
|
$ScriptText = Get-Content -LiteralPath $ScriptPath -Raw
|
|
|
|
function Assert-Match {
|
|
param(
|
|
[string]$Pattern,
|
|
[string]$Message
|
|
)
|
|
|
|
if ($ScriptText -notmatch $Pattern) {
|
|
throw $Message
|
|
}
|
|
}
|
|
|
|
Assert-Match '\[string\]\$Remote\s*=\s*"akai-tools"' "Launcher must pull from akai-tools by default."
|
|
Assert-Match 'status\s+--porcelain\s+--untracked-files=no\s+--ignore-submodules=dirty' "Clean check must ignore runtime logs and dirty submodule contents."
|
|
Assert-Match 'Get-NetTCPConnection[^\r\n]*-LocalPort\s+3000' "Launcher must inspect the Tauri dev port before starting."
|
|
Assert-Match 'Stop-Process[^\r\n]*-Id\s+\$ownerPid' "Launcher must stop an old Readest/Next process that owns port 3000."
|
|
Assert-Match 'Port 3000 is occupied' "Launcher must report an actionable error for an unrelated port owner."
|
|
Assert-Match 'Port 3000 is still occupied' "Launcher must wait for the previous dev server to release the port."
|
|
|
|
Write-Host "open-readest-latest launcher checks passed."
|