Normalize slashes to dots when calling require in Utils.loadNamespace

Co-authored-by: Ulhar <ulhar@protonmail.ch>
This commit is contained in:
Pablo Mayobre 2023-02-14 22:28:26 -03:00
parent 1e4132be21
commit 2386547caa
No known key found for this signature in database
GPG key ID: 13A2F589D013E0E7

View file

@ -44,7 +44,7 @@ function Utils.loadNamespace(pathOrFiles, namespace)
local name = file:sub(1, #file - 4)
local path = pathOrFiles.."."..name
local value = require(path)
local value = require(path:gsub("%/", "."))
if namespace then namespace[name] = value end
end
end
@ -61,7 +61,7 @@ function Utils.loadNamespace(pathOrFiles, namespace)
name = path:sub((dotIndex or slashIndex) + 1)
end
local value = require(path)
local value = require(path:gsub("%/", "."))
if namespace then namespace[name] = value end
end
end