Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions scripts/ofs3/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ ofs3.session = {}

package.loaded.ofs3 = ofs3

-- If you still want to ban accidental globals in this chunk:
-- Print warning if accidental globals:
local _ENV = setmetatable({ ofs3 = ofs3 }, {
__index = _G,
__newindex = function(_, k) error("attempt to create global '"..tostring(k).."'", 2) end
__newindex = function(_, k) print("attempt to create global '"..tostring(k).."'", 2) end
})

-- ETHOS font compatibility (1.6 vs 1.7)
Expand Down
33 changes: 0 additions & 33 deletions scripts/ofs3/tasks/compiler/compiler.lua

This file was deleted.

28 changes: 0 additions & 28 deletions scripts/ofs3/tasks/compiler/init.lua

This file was deleted.

10 changes: 5 additions & 5 deletions scripts/ofs3/tasks/tasks.lua
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ function tasks.initialize()
for _, dir in pairs(system.listFiles(taskPath)) do
if dir ~= "." and dir ~= ".." and not dir:match("%.%a+$") then
local initPath = taskPath .. dir .. "/init.lua"
local func, err = compiler(initPath)
local func, err = loadfile(initPath)
if err then
utils.log("Error loading " .. initPath .. ": " .. err, "info")
elseif func then
Expand Down Expand Up @@ -221,7 +221,7 @@ function tasks.findTasks()
for _, dir in pairs(system.listFiles(taskPath)) do
if dir ~= "." and dir ~= ".." and not dir:match("%.%a+$") then
local initPath = taskPath .. dir .. "/init.lua"
local func, err = compiler(initPath)
local func, err = loadfile(initPath)
if err then
utils.log("Error loading " .. initPath .. ": " .. err, "info")
elseif func then
Expand All @@ -230,7 +230,7 @@ function tasks.findTasks()
utils.log("Invalid configuration in " .. initPath, "debug")
else
local scriptPath = taskPath .. dir .. "/" .. tconfig.script
local fn, loadErr = compiler(scriptPath)
local fn, loadErr = loadfile(scriptPath)
if fn then
tasks[dir] = fn(config) -- assumes global 'config'
else
Expand Down Expand Up @@ -428,15 +428,15 @@ function tasks.wakeup()
if key then
local meta = tasks._initMetadata[key]
if meta.init then
local initFn, err = compiler(meta.init)
local initFn, err = loadfile(meta.init)
if initFn then
pcall(initFn)
else
utils.log("Failed to load init for " .. key .. ": " .. (err or "unknown error"), "info")
end
end
local script = "tasks/" .. key .. "/" .. meta.script
local module = assert(compiler(script))(config) -- assumes global 'config'
local module = assert(loadfile(script))(config) -- assumes global 'config'
tasks[key] = module

if meta.interval >= 0 then
Expand Down