The previous commit fixed the target catalog and the operator alarm, but the actuators the catalog invokes carried the same E: paths. Idunn would have resolved every target and then failed on the first restart or deploy it ran, for exactly the reason the alarm failed. Rebased 41 references across 27 scripts: - .cmd bodies invoke their sibling .ps1 through %~dp0 instead of an absolute drive path, and restart-weksa.cmd reaches its sibling repo the same way. - .ps1 parameter defaults and assignments derive from $PSScriptRoot: one level up for paths inside Odin, two for sibling repos under the projects root. Left deliberately alone: $RemoteViliRoot and $StateRoot in restart-vili.ps1. Both are consumed inside the EncodedCommand block that restart-vili ssh's to raven, so they describe raven's filesystem, not starfire's. Whether raven also moved off E: is an operator question, not something to infer from here. Verified: all 46 scripts under scripts/ parse clean, and the derivation resolves to F:\Projects\Odin and F:\Projects on this host. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
21 lines
779 B
PowerShell
21 lines
779 B
PowerShell
$ErrorActionPreference = "Stop"
|
|
|
|
$stonksRoot = (Join-Path (Split-Path -Parent (Split-Path -Parent $PSScriptRoot)) "Stonks")
|
|
$stateDir = Join-Path $stonksRoot "scratch\stonks"
|
|
$pidPath = Join-Path $stateDir "stonks.pid"
|
|
$startScript = Join-Path $stonksRoot "scripts\start-stonks.ps1"
|
|
|
|
if (Test-Path -LiteralPath $pidPath) {
|
|
$pidText = (Get-Content -LiteralPath $pidPath -Raw).Trim()
|
|
if ($pidText -match "^\d+$") {
|
|
$process = Get-Process -Id ([int] $pidText) -ErrorAction SilentlyContinue
|
|
if ($null -ne $process) {
|
|
Stop-Process -Id $process.Id -Force
|
|
Start-Sleep -Milliseconds 500
|
|
}
|
|
}
|
|
Remove-Item -LiteralPath $pidPath -Force -ErrorAction SilentlyContinue
|
|
}
|
|
|
|
& powershell.exe -NoProfile -ExecutionPolicy Bypass -File $startScript
|
|
exit $LASTEXITCODE
|