mirror of
https://github.com/MCKero6423/uv-k5-v3-emulator.git
synced 2026-10-02 03:15:36 +00:00
Keep what the page installed when the server restarts
The page edits a working copy of the flash image on purpose -- the file it was first pointed at may be a real calibration dump -- but a restart pointed at a different image switched to that file's copy instead, and the games installed through the page looked like they had vanished (measured: the app table came back holding an older slot). work/run-webui.ps1 now prefers the working copy the page has been editing, ahead of the original, and the page's own hint says which image it is editing and that the loaded one is never modified. A test asserts the order in the script.
This commit is contained in:
1 parent
673c181d59
commit
dcf9dc00f5
3 files changed
+29
-2
No files matched your search
+6
-1
@@ -46,7 +46,12 @@ if ($Status) { $common += @('--status-addr', $Status) }
|
||||
|
||||
if (-not $Kernel -and $env:ELF) { $Kernel = $env:ELF }
|
||||
if (-not $Flash) {
|
||||
$candidates = @($env:UVK5_FLASH_IMAGE, 'work\user-flash.img', 'assets\flash.img')
|
||||
# The page edits a working copy (webui copies the image before its first write, so a
|
||||
# real calibration dump is never touched). Preferring it here means a restart keeps
|
||||
# whatever was installed through the page, instead of silently falling back to the
|
||||
# file it was first pointed at and looking like the install vanished.
|
||||
$candidates = @($env:UVK5_FLASH_IMAGE, 'work\firmware\flash-current.img',
|
||||
'work\user-flash.img', 'assets\flash.img')
|
||||
foreach ($candidate in $candidates) {
|
||||
if ($candidate -and (Test-Path $candidate)) { $Flash = $candidate; break }
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user