fix: mock alarm and minio use cmd window to avoid silent exit
This commit is contained in:
parent
56dcee8741
commit
848580f3ee
@ -119,12 +119,10 @@ function Invoke-Start {
|
||||
# 3. Mock alarm server (if uv available)
|
||||
Write-Banner "3/4 Mock Alarm Server"
|
||||
if (Get-Command uv -ErrorAction SilentlyContinue) {
|
||||
$alarmProc = Start-Process -FilePath "uv" `
|
||||
-ArgumentList "run", "--with", "flask", $mockAlarm `
|
||||
-WorkingDirectory (Join-Path $edgeDir "scripts") `
|
||||
-WindowStyle Minimized `
|
||||
-PassThru
|
||||
Write-Host " [START] mock_alarm_server (PID=$($alarmProc.Id))" -ForegroundColor Green
|
||||
$alarmBat = Join-Path $edgeDir "scripts\mock-alarm.bat"
|
||||
"@echo off`r`ncd /d `"$(Join-Path $edgeDir 'scripts')`"`r`nuv run --with flask mock_alarm_server.py" | Out-File -FilePath $alarmBat -Encoding ASCII
|
||||
Start-Process "cmd" -ArgumentList "/k", $alarmBat
|
||||
Write-Host " [START] mock_alarm_server (端口 8080)" -ForegroundColor Green
|
||||
} else {
|
||||
Write-Host " [SKIP] uv 未安装" -ForegroundColor Yellow
|
||||
}
|
||||
@ -152,7 +150,9 @@ function Invoke-Start {
|
||||
Write-Banner "MinIO (object storage)"
|
||||
if (Test-Path $minio) {
|
||||
if (-not (Test-Path $minioData)) { New-Item -ItemType Directory -Path $minioData -Force | Out-Null }
|
||||
Start-Detached "minio" $minio @("server", $minioData, "--address", ":9000", "--console-address", ":9001")
|
||||
$minioBat = Join-Path $env:TEMP "safesight-minio.bat"
|
||||
"@echo off`r`n`"$minio`" server `"$minioData`" --address :9000 --console-address :9001" | Out-File -FilePath $minioBat -Encoding ASCII
|
||||
Start-Process "cmd" -ArgumentList "/k", $minioBat
|
||||
Write-Host " Console: http://localhost:9001 (admin/password)" -ForegroundColor White
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user