Fix check-files ordering headers by folder count for different libs

This commit is contained in:
SirLynix
2023-08-10 08:59:50 +02:00
parent 494a83e817
commit efa2a30934
2 changed files with 13 additions and 5 deletions

View File

@@ -519,10 +519,18 @@ on_run(function ()
local function compareFunc(a, b)
if a.order == b.order then
local moduleA = a.path:match("^Nazara/(.-)/")
local moduleB = b.path:match("^Nazara/(.-)/")
if moduleA ~= moduleB then
return moduleA < moduleB
local folderA = a.path:match("^(.-)/")
local folderB = b.path:match("^(.-)/")
if folderA and folderB then
if folderA ~= folderB then
return folderA < folderB
end
local moduleA = a.path:match("^Nazara/(.-)/")
local moduleB = b.path:match("^Nazara/(.-)/")
if moduleA ~= moduleB then
return moduleA < moduleB
end
end
local _, folderCountA = a.path:gsub("/", "")