51 lines
1006 B
Lua
51 lines
1006 B
Lua
local updater = require("updater");
|
|
local log = require("log");
|
|
local notifier = require("notifier")
|
|
local json = require("json")
|
|
|
|
local MODULE_NAME = "keypadOS";
|
|
local MODULE_URL = "https://git.mcorangehq.xyz/xomf/keypadOS/raw/branch/keypad/keypadOS.lua";
|
|
|
|
if not __VERSION then
|
|
__VERSION = "DEV";
|
|
end
|
|
|
|
|
|
|
|
|
|
--- @param upd Updater
|
|
local function updaterLoop(upd)
|
|
while true do
|
|
sleep(1)
|
|
upd:checkAndUpdateAll();
|
|
end
|
|
end
|
|
|
|
local function _start()
|
|
log.info("Starting bootloader (" .. __VERSION .. ")");
|
|
local upd = updater.new();
|
|
upd:addEntry(MODULE_NAME .. ".lua", "keypad", MODULE_URL);
|
|
|
|
--- @type Exports
|
|
local lib_exports = {
|
|
log = log,
|
|
updater = upd,
|
|
notifier = notifier,
|
|
json = json
|
|
};
|
|
|
|
parallel.waitForAny(
|
|
function()
|
|
updaterLoop(upd)
|
|
end,
|
|
function ()
|
|
require(MODULE_NAME).main(lib_exports);
|
|
end
|
|
);
|
|
end
|
|
|
|
local mod = {};
|
|
mod.main = _start;
|
|
return mod;
|
|
|