From efa2a309343532949e9fbd750dc0f5c9246ef1b4 Mon Sep 17 00:00:00 2001 From: SirLynix Date: Thu, 10 Aug 2023 08:59:50 +0200 Subject: [PATCH] Fix check-files ordering headers by folder count for different libs --- src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp | 2 +- xmake/actions/checkfiles.lua | 16 ++++++++++++---- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp index 3a1a15293..82478a2ec 100644 --- a/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp +++ b/src/Nazara/JoltPhysics3D/JoltPhysWorld3D.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include #include #include @@ -22,6 +21,7 @@ #include #include #include +#include #include #include diff --git a/xmake/actions/checkfiles.lua b/xmake/actions/checkfiles.lua index 833b6ce10..1e23ac6cd 100644 --- a/xmake/actions/checkfiles.lua +++ b/xmake/actions/checkfiles.lua @@ -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("/", "")