mirror of
https://github.com/Adorable-Catgirl/Zorya-NEO.git
synced 2024-11-13 14:08:07 +11:00
19 lines
488 B
Lua
19 lines
488 B
Lua
local cfgadd = ...
|
|
local fs = require("filesystem")
|
|
if not fs.exists("/etc/zorya-neo/entries/") then
|
|
return
|
|
end
|
|
local function readfile(path)
|
|
local f = io.open(path)
|
|
local dat = f:read("*a")
|
|
f:close()
|
|
return dat
|
|
end
|
|
for ent in fs.list("/etc/zorya-neo/entries/") do
|
|
local label = readfile("/etc/zorya-neo/entries/"..ent.."/label.txt")
|
|
local code = readfile("/etc/zorya-neo/entries/"..ent.."/code.lua")
|
|
cfgadd(string.format([[
|
|
menu.add("%s", function())
|
|
%s
|
|
end)]], label, code))
|
|
end |