Files
ai_site/restart.ps1
2026-07-31 10:19:22 +08:00

24 lines
704 B
PowerShell

# restart: stop then start
param(
[switch]$Rebuild,
[switch]$UseHost,
[switch]$NoBrowser,
[switch]$ShowConsole
)
$ErrorActionPreference = "Continue"
$Root = $PSScriptRoot
Set-Location -LiteralPath $Root
Write-Host "==> Restart: stopping..." -ForegroundColor Yellow
& (Join-Path $Root "scripts\Stop-Stack.ps1")
if ($LASTEXITCODE -ne 0 -and $LASTEXITCODE -ne $null) {
Write-Host " (stop reported leftovers; continuing restart anyway)" -ForegroundColor DarkGray
}
Start-Sleep -Seconds 2
Write-Host "==> Restart: starting..." -ForegroundColor Cyan
& (Join-Path $Root "start.ps1") -Rebuild:$Rebuild -UseHost:$UseHost -NoBrowser:$NoBrowser -ShowConsole:$ShowConsole
exit $LASTEXITCODE