From 2386547caa1a0602394a2a2c151717ce9400a95d Mon Sep 17 00:00:00 2001 From: Pablo Mayobre Date: Tue, 14 Feb 2023 22:28:26 -0300 Subject: [PATCH] Normalize slashes to dots when calling require in Utils.loadNamespace Co-authored-by: Ulhar --- concord/utils.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/concord/utils.lua b/concord/utils.lua index b33b719..0802586 100644 --- a/concord/utils.lua +++ b/concord/utils.lua @@ -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