patch management

Use texteditor if available

Auto disable if patches folder doesnt exist

And show a restart message after file edit

Sort menu entries in execution order

Warning sign for failing patches
This commit is contained in:
zwim
2022-12-30 08:45:27 +01:00
committed by zwim
parent cf9d3a0d70
commit 4e944dc918
5 changed files with 203 additions and 0 deletions

View File

@@ -15,6 +15,11 @@ local userpatch = {
before_exit = "8", -- to be started a bit before exit before settings are saved (always)
on_exit = "9", -- to be started right before exit (always)
-- hash table for patch execution status
-- key: name of the patch
-- value: true (success), false (failure), nil (not executed)
execution_status = {},
-- the patch function itself
applyPatches = function(priority) end, -- to be overwritten, if the device allows it.
}
@@ -64,6 +69,7 @@ local function runUserPatchTasks(dir, priority)
if fullpath:match("%.lua$") then -- execute patch-files first
logger.info("Applying patch:", fullpath)
local ok, err = pcall(dofile, fullpath)
userpatch.execution_status[entry] = ok
if not ok then
logger.warn("Patching failed:", err)
-- Only show InfoMessage, when UIManager is working