From 8869adfb33e0c0109dad606331fe239b1af6e75f Mon Sep 17 00:00:00 2001 From: cheapie Date: Sat, 13 Dec 2025 12:42:58 -0600 Subject: Remove deprecated DIR_DELIM usage Apparently "/" gets translated to the right path separator for the current OS. This seems to not be documented anywhere, but DIR_DELIM wasn't either, so... *shrug* --- .luacheckrc | 1 - controller.lua | 4 ++-- controllerfw.lua | 2 +- dispatcher.lua | 4 ++-- dispatcherfw.lua | 2 +- init.lua | 2 +- 6 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.luacheckrc b/.luacheckrc index 755b8ce..3fbc5b1 100644 --- a/.luacheckrc +++ b/.luacheckrc @@ -5,7 +5,6 @@ globals = { } read_globals = { - "DIR_DELIM", "vector", "screwdriver", "core", diff --git a/controller.lua b/controller.lua index d8fb873..bf351ef 100644 --- a/controller.lua +++ b/controller.lua @@ -6,7 +6,7 @@ celevator.controller.equeue = core.deserialize(celevator.storage:get_string("con celevator.controller.running = {} -local fw,err = loadfile(core.get_modpath("celevator")..DIR_DELIM.."controllerfw.lua") +local fw,err = loadfile(core.get_modpath("celevator").."/controllerfw.lua") if not fw then error(err) end core.register_chatcommand("celevator_reloadcontroller",{ @@ -14,7 +14,7 @@ core.register_chatcommand("celevator_reloadcontroller",{ description = "Reload celevator controller firmware from disk", privs = {server = true}, func = function() - local newfw,loaderr = loadfile(core.get_modpath("celevator")..DIR_DELIM.."controllerfw.lua") + local newfw,loaderr = loadfile(core.get_modpath("celevator").."/controllerfw.lua") if newfw then fw = newfw return true,"Firmware reloaded successfully" diff --git a/controllerfw.lua b/controllerfw.lua index d04ff91..0ac2878 100644 --- a/controllerfw.lua +++ b/controllerfw.lua @@ -1302,7 +1302,7 @@ if mem.screenstate == "oobe_welcome" then fs("button[1,10;2,1;license;License Info]") fs("button[13,10;2,1;next;Next >]") elseif mem.screenstate == "oobe_license" then - local licensefile = io.open(core.get_modpath("celevator")..DIR_DELIM.."LICENSE") + local licensefile = io.open(core.get_modpath("celevator").."/LICENSE") local license = core.formspec_escape(licensefile:read("*all")) licensefile:close() fs("textarea[1,1;14,8;license;This applies to the whole celevator mod\\, not just this controller:;"..license.."]") diff --git a/dispatcher.lua b/dispatcher.lua index b38a4c3..165db68 100644 --- a/dispatcher.lua +++ b/dispatcher.lua @@ -6,7 +6,7 @@ celevator.dispatcher.equeue = core.deserialize(celevator.storage:get_string("dis celevator.dispatcher.running = {} -local fw,err = loadfile(core.get_modpath("celevator")..DIR_DELIM.."dispatcherfw.lua") +local fw,err = loadfile(core.get_modpath("celevator").."/dispatcherfw.lua") if not fw then error(err) end core.register_chatcommand("celevator_reloaddispatcher",{ @@ -14,7 +14,7 @@ core.register_chatcommand("celevator_reloaddispatcher",{ description = "Reload celevator dispatcher firmware from disk", privs = {server = true}, func = function() - local newfw,loaderr = loadfile(core.get_modpath("celevator")..DIR_DELIM.."dispatcherfw.lua") + local newfw,loaderr = loadfile(core.get_modpath("celevator").."/dispatcherfw.lua") if newfw then fw = newfw return true,"Firmware reloaded successfully" diff --git a/dispatcherfw.lua b/dispatcherfw.lua index 27066b4..ef891a6 100644 --- a/dispatcherfw.lua +++ b/dispatcherfw.lua @@ -936,7 +936,7 @@ if mem.screenstate == "oobe_welcome" then fs("button[1,10;2,1;license;License Info]") fs("button[13,10;2,1;next;Next >]") elseif mem.screenstate == "oobe_license" then - local licensefile = io.open(core.get_modpath("celevator")..DIR_DELIM.."LICENSE") + local licensefile = io.open(core.get_modpath("celevator").."/LICENSE") local license = core.formspec_escape(licensefile:read("*all")) licensefile:close() fs("textarea[1,1;14,8;license;This applies to the whole celevator mod\\, not just this dispatcher:;"..license.."]") diff --git a/init.lua b/init.lua index 13141c7..5348231 100644 --- a/init.lua +++ b/init.lua @@ -32,5 +32,5 @@ for _,i in ipairs(integrations) do end for _,v in ipairs(components) do - dofile(string.format("%s%s%s.lua",core.get_modpath("celevator"),DIR_DELIM,v)) + dofile(string.format("%s/%s.lua",core.get_modpath("celevator"),v)) end -- cgit v1.2.3