From dad04f35d694d7803bc51a48f94f689337b329fe Mon Sep 17 00:00:00 2001 From: MCorange Date: Sun, 18 Aug 2024 04:13:38 +0300 Subject: [PATCH] lfpans;od --- keypadOS.lua | 22 +++++++++++----------- x.py | 6 +++--- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/keypadOS.lua b/keypadOS.lua index f257662..5b8f4a1 100644 --- a/keypadOS.lua +++ b/keypadOS.lua @@ -4,11 +4,11 @@ local require = function(path) if __BUNDLER_FILES[path] then return __BUNDLER_FILES[path]() else - __DEFAULT_IMPORT(path) + return __DEFAULT_IMPORT(path) end end -__BUNDLER_FILES["updater.lua"] = function () +rawset(__BUNDLER_FILES, "updater.lua", function () local utils = require("utils.lua") local LAST_USED = os.time() local function checkForUpdate() @@ -65,16 +65,16 @@ __BUNDLER_FILES["updater.lua"] = function () GetBasalt } -end -- FILE END: updater.lua -- +end) -- FILE END: updater.lua -- -__BUNDLER_FILES["config.lua"] = function () +rawset(__BUNDLER_FILES, "config.lua", function () return { correctPin = "42169" } -end -- FILE END: config.lua -- +end) -- FILE END: config.lua -- -__BUNDLER_FILES["ui.lua"] = function () +rawset(__BUNDLER_FILES, "ui.lua", function () local utils = require("utils.lua") local basalt = require("basalt") local config = require("config.lua") @@ -184,9 +184,9 @@ __BUNDLER_FILES["ui.lua"] = function () InitUi, } -end -- FILE END: ui.lua -- +end) -- FILE END: ui.lua -- -__BUNDLER_FILES["utils.lua"] = function () +rawset(__BUNDLER_FILES, "utils.lua", function () -- Type coersion for lsp ---@generic T ---@param object any @@ -212,9 +212,9 @@ __BUNDLER_FILES["utils.lua"] = function () Cast, } -end -- FILE END: utils.lua -- +end) -- FILE END: utils.lua -- -__BUNDLER_FILES["main.lua"] = function () +rawset(__BUNDLER_FILES, "main.lua", function () -- keycardOS "bootloader", has no access to basalt -- intended for checking for updates, and automatically updating basalt if it is missing local utils = require("utils.lua") @@ -232,6 +232,6 @@ __BUNDLER_FILES["main.lua"] = function () Main } -end -- FILE END: main.lua -- +end) -- FILE END: main.lua -- require("main.lua").Main() diff --git a/x.py b/x.py index 80b96d8..4096655 100755 --- a/x.py +++ b/x.py @@ -12,11 +12,11 @@ FILES= [ def read_file(p: str) -> str: buf = ""; with open("src/"+p, "r", encoding="utf-8") as f: - buf += f"\n__BUNDLER_FILES[\"{p}\"] = function ()\n"; + buf += f"\nrawset(__BUNDLER_FILES, \"{p}\", function ()\n"; for line in f.readlines(): if str.strip(line) != "": buf += " " + line; - buf += f"\nend -- FILE END: {p} --\n"; + buf += f"\nend) -- FILE END: {p} --\n"; return buf; @@ -28,7 +28,7 @@ def main(): buf += " if __BUNDLER_FILES[path] then\n"; buf += " return __BUNDLER_FILES[path]()\n"; buf += " else\n"; - buf += " __DEFAULT_IMPORT(path)\n"; + buf += " return __DEFAULT_IMPORT(path)\n"; buf += " end\n"; buf += "end\n";