fix: fix lua files conversion to module
This commit is contained in:
parent
a1a130ae32
commit
05169782a2
1 changed files with 2 additions and 2 deletions
|
@ -27,12 +27,12 @@ local DATADIR = "datas"
|
||||||
local GAMEDATADIR = "gamedata"
|
local GAMEDATADIR = "gamedata"
|
||||||
|
|
||||||
function DataUtils.isLuaFile(name)
|
function DataUtils.isLuaFile(name)
|
||||||
local extension = name:sub(#name - 4, #name)
|
local extension = name:sub(#name - 3, #name)
|
||||||
return (extension == ".lua")
|
return (extension == ".lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
function DataUtils.luaFileToModule(luaFile)
|
function DataUtils.luaFileToModule(luaFile)
|
||||||
if (not DataUtils.isLuaFile(luaFile)) then
|
if (DataUtils.isLuaFile(luaFile)) then
|
||||||
return luaFile:sub(1, #luaFile - 4)
|
return luaFile:sub(1, #luaFile - 4)
|
||||||
else
|
else
|
||||||
return luaFile
|
return luaFile
|
||||||
|
|
Loading…
Reference in a new issue