diff --git a/init.lua b/init.lua index d270048..f38da44 100644 --- a/init.lua +++ b/init.lua @@ -23,11 +23,11 @@ yl_scheduler.information.additional = "Execute tasks based on utc" dofile(yl_scheduler.modpath .. "config.lua") dofile(yl_scheduler.modpath .. "setup.lua") -dofile(yl_scheduler.modpath .. "privs.lua") -dofile(yl_scheduler.modpath .. "internal.lua") -dofile(yl_scheduler.modpath .. "api.lua") -dofile(yl_scheduler.modpath .. "globalsteps.lua") -dofile(yl_scheduler.modpath .. "chatcommands.lua") +--dofile(yl_scheduler.modpath .. "privs.lua") +--dofile(yl_scheduler.modpath .. "internal.lua") +--dofile(yl_scheduler.modpath .. "api.lua") +--dofile(yl_scheduler.modpath .. "globalsteps.lua") +--dofile(yl_scheduler.modpath .. "chatcommands.lua") local mod_end_time = (core.get_us_time() - mod_start_time) / 1000000 core.log("action", "[MOD] yl_scheduler loaded in [" .. mod_end_time .. "s]") diff --git a/setup.lua b/setup.lua index ac4c614..08617e5 100644 --- a/setup.lua +++ b/setup.lua @@ -1,16 +1,17 @@ +local mkdir = minetest.mkdir +local save_path = yl_scheduler.settings.save_path + local function run_once() - local dl = minetest.get_dir_list(yl_template.worldpath, true) - local create = true - for _, v in ipairs(dl) do - if v == yl_template.settings.save_path then - create = false - end + local path = yl_scheduler.worldpath .. DIR_DELIM .. save_path + + local file = io.open(path, "r") + if not file then + mkdir(path) + else + file:close() end - if create then - minetest.mkdir(yl_template.worldpath .. DIR_DELIM .. yl_template.settings.save_path) - end end run_once()