1
0
mirror of https://github.com/kepler155c/opus synced 2024-11-16 05:34:49 +00:00
opus/sys/apis/opus.lua
kepler155c@gmail.com f325550de2 better startup
2017-09-25 17:00:02 -04:00

40 lines
800 B
Lua

local Opus = { }
local function runDir(directory, desc, open)
if not fs.exists(directory) then
return true
end
local success = true
local files = fs.list(directory)
table.sort(files)
for _,file in ipairs(files) do
--print(desc .. file)
os.sleep(0)
local result, err = open(directory .. '/' .. file)
if not result then
printError(err)
success = false
end
end
return success
end
function Opus.loadExtensions()
--return runDir('sys/extensions', '[ ext ] ', shell.run)
return true
end
function Opus.loadServices()
return runDir('sys/services', '[ svc ] ', shell.openHiddenTab)
end
function Opus.autorun()
local s = runDir('sys/autorun', '[ aut ] ', shell.run)
return runDir('usr/autorun', '[ aut ] ', shell.run) and s
end
return Opus