pack-dist: refuse to repack while the game runs from dist
Remove-Item raced a live playtest session and gutted the folder around the locked files. Detect a running rpl4opt.exe under dist and abort before deleting anything. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -27,6 +27,13 @@ if (-not (Test-Path $exe)) {
|
|||||||
throw "Release\rpl4opt.exe not found - build first (see BUILD.md 2)."
|
throw "Release\rpl4opt.exe not found - build first (see BUILD.md 2)."
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Refuse to touch a dist the game is currently running from.
|
||||||
|
$running = Get-Process rpl4opt -ErrorAction SilentlyContinue |
|
||||||
|
Where-Object { $_.Path -like "$dist\*" }
|
||||||
|
if ($running) {
|
||||||
|
throw "rpl4opt.exe is running from $dist (PID $($running.Id)) - close the game first."
|
||||||
|
}
|
||||||
|
|
||||||
Write-Host "Packing into $dist"
|
Write-Host "Packing into $dist"
|
||||||
if (Test-Path $dist) { Remove-Item -Recurse -Force $dist }
|
if (Test-Path $dist) { Remove-Item -Recurse -Force $dist }
|
||||||
New-Item -ItemType Directory -Force "$dist\SPOOLS" | Out-Null
|
New-Item -ItemType Directory -Force "$dist\SPOOLS" | Out-Null
|
||||||
|
|||||||
Reference in New Issue
Block a user