added exports to modules
This commit is contained in:
		
							parent
							
								
									ffa88f010c
								
							
						
					
					
						commit
						2b744a5813
					
				| 
						 | 
				
			
			@ -22,6 +22,7 @@
 | 
			
		|||
-- SOFTWARE.
 | 
			
		||||
--
 | 
			
		||||
 | 
			
		||||
--- @class JsonParser
 | 
			
		||||
local json = { _version = "0.1.2" }
 | 
			
		||||
 | 
			
		||||
-------------------------------------------------------------------------------
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -1,3 +1,5 @@
 | 
			
		|||
 | 
			
		||||
--- @class Logger
 | 
			
		||||
local log = {};
 | 
			
		||||
log.__index = log;
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
							
								
								
									
										27
									
								
								src/main.lua
									
									
									
									
									
								
							
							
						
						
									
										27
									
								
								src/main.lua
									
									
									
									
									
								
							| 
						 | 
				
			
			@ -1,5 +1,7 @@
 | 
			
		|||
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";
 | 
			
		||||
| 
						 | 
				
			
			@ -8,6 +10,13 @@ if not __VERSION then
 | 
			
		|||
    __VERSION = "DEV";
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
--- @class Exports
 | 
			
		||||
--- @field log Logger
 | 
			
		||||
--- @field updater Updater
 | 
			
		||||
--- @field notifier Notifier
 | 
			
		||||
--- @field json JsonParser
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
--- @param upd Updater
 | 
			
		||||
local function updaterLoop(upd)
 | 
			
		||||
    while true do
 | 
			
		||||
| 
						 | 
				
			
			@ -20,7 +29,23 @@ local function _start()
 | 
			
		|||
    log.info("Starting bootloader (" .. __VERSION .. ")");
 | 
			
		||||
    local upd = updater.new();
 | 
			
		||||
    upd:addEntry(MODULE_NAME .. ".lua", "keypad", MODULE_URL);
 | 
			
		||||
    parallel.waitForAny(function() updaterLoop(upd) end, require(MODULE_NAME))
 | 
			
		||||
 | 
			
		||||
    --- @type Exports
 | 
			
		||||
    local lib_exports = {
 | 
			
		||||
        log = log,
 | 
			
		||||
        updater = upd,
 | 
			
		||||
        notifier = notifier,
 | 
			
		||||
        json = json
 | 
			
		||||
    };
 | 
			
		||||
 | 
			
		||||
    parallel.waitForAny(
 | 
			
		||||
        function()
 | 
			
		||||
            updaterLoop(upd)
 | 
			
		||||
        end,
 | 
			
		||||
        function ()
 | 
			
		||||
            require(MODULE_NAME)(lib_exports);
 | 
			
		||||
        end
 | 
			
		||||
    );
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local mod = {};
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue
	
	Block a user