lfpans;od

This commit is contained in:
Gvidas Juknevičius 2024-08-18 04:13:38 +03:00
parent c3e1cd0438
commit dad04f35d6
Signed by: MCorange
GPG Key ID: 12B1346D720B7FBB
2 changed files with 14 additions and 14 deletions

View File

@ -4,11 +4,11 @@ local require = function(path)
if __BUNDLER_FILES[path] then if __BUNDLER_FILES[path] then
return __BUNDLER_FILES[path]() return __BUNDLER_FILES[path]()
else else
__DEFAULT_IMPORT(path) return __DEFAULT_IMPORT(path)
end end
end end
__BUNDLER_FILES["updater.lua"] = function () rawset(__BUNDLER_FILES, "updater.lua", function ()
local utils = require("utils.lua") local utils = require("utils.lua")
local LAST_USED = os.time() local LAST_USED = os.time()
local function checkForUpdate() local function checkForUpdate()
@ -65,16 +65,16 @@ __BUNDLER_FILES["updater.lua"] = function ()
GetBasalt GetBasalt
} }
end -- FILE END: updater.lua -- end) -- FILE END: updater.lua --
__BUNDLER_FILES["config.lua"] = function () rawset(__BUNDLER_FILES, "config.lua", function ()
return { return {
correctPin = "42169" 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 utils = require("utils.lua")
local basalt = require("basalt") local basalt = require("basalt")
local config = require("config.lua") local config = require("config.lua")
@ -184,9 +184,9 @@ __BUNDLER_FILES["ui.lua"] = function ()
InitUi, 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 -- Type coersion for lsp
---@generic T ---@generic T
---@param object any ---@param object any
@ -212,9 +212,9 @@ __BUNDLER_FILES["utils.lua"] = function ()
Cast, 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 -- keycardOS "bootloader", has no access to basalt
-- intended for checking for updates, and automatically updating basalt if it is missing -- intended for checking for updates, and automatically updating basalt if it is missing
local utils = require("utils.lua") local utils = require("utils.lua")
@ -232,6 +232,6 @@ __BUNDLER_FILES["main.lua"] = function ()
Main Main
} }
end -- FILE END: main.lua -- end) -- FILE END: main.lua --
require("main.lua").Main() require("main.lua").Main()

6
x.py
View File

@ -12,11 +12,11 @@ FILES= [
def read_file(p: str) -> str: def read_file(p: str) -> str:
buf = ""; buf = "";
with open("src/"+p, "r", encoding="utf-8") as f: 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(): for line in f.readlines():
if str.strip(line) != "": if str.strip(line) != "":
buf += " " + line; buf += " " + line;
buf += f"\nend -- FILE END: {p} --\n"; buf += f"\nend) -- FILE END: {p} --\n";
return buf; return buf;
@ -28,7 +28,7 @@ def main():
buf += " if __BUNDLER_FILES[path] then\n"; buf += " if __BUNDLER_FILES[path] then\n";
buf += " return __BUNDLER_FILES[path]()\n"; buf += " return __BUNDLER_FILES[path]()\n";
buf += " else\n"; buf += " else\n";
buf += " __DEFAULT_IMPORT(path)\n"; buf += " return __DEFAULT_IMPORT(path)\n";
buf += " end\n"; buf += " end\n";
buf += "end\n"; buf += "end\n";