Files
meguri/scripts/stop-dev.ps1
T
ab a47c4a0398
Checks / test (push) Failing after 12m20s
Init
2026-09-24 14:35:05 +03:00

14 lines
680 B
PowerShell

$ErrorActionPreference = 'Stop'
$repo = [IO.Path]::GetFullPath((Join-Path $PSScriptRoot '..'))
$localDir = Join-Path $repo 'target/local'
$pidFile = Join-Path $localDir 'app.pid'
if (Test-Path $pidFile) {
$app = Get-Process -Id ([int](Get-Content $pidFile)) -ErrorAction SilentlyContinue
if ($app -and $app.Path -eq (Join-Path $localDir 'meguri-dev.exe')) { Stop-Process -Id $app.Id }
Remove-Item -LiteralPath $pidFile
}
if (Test-Path (Join-Path $localDir 'settings.json')) {
$settings = Get-Content (Join-Path $localDir 'settings.json') | ConvertFrom-Json
& (Join-Path $settings.postgresBin 'pg_ctl.exe') -D (Join-Path $localDir 'postgres') -m fast -w stop
}