Skip to content

Commit

Permalink
binary: fix extraction of basename
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamhm committed May 10, 2024
1 parent 4478a82 commit 8479c93
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion extras/binary.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,10 @@ local function declare_modules(out, basename, files)
]])
for _, filename in ipairs(files) do
if filename:match("%.lua$") then
local name = filename:gsub("^" .. basename .. "/", "")
local name = filename
if filename:sub(1, #basename + 1) == basename .. "/" then
name = filename:sub(#basename + 2)
end
local modname = name:gsub("%.lua$", ""):gsub("/", ".")
table.insert(out, ("/* %s */"):format(modname))
table.insert(out, ("{"))
Expand Down

0 comments on commit 8479c93

Please sign in to comment.