mirror of
https://github.com/koreader/koreader.git
synced 2025-08-10 00:52:38 +00:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user