update List.lua

This commit is contained in:
2025-08-01 12:53:25 +03:00
parent 5cdfb2a543
commit 30a87fdb4c

View File

@@ -10,7 +10,7 @@ if In.Params and In.Params.about then
return return
end end
local function isValidCommand(name) local function isValidName(name)
return name:match("^[%w]+$") ~= nil return name:match("^[%w]+$") ~= nil
end end
@@ -21,8 +21,20 @@ local function scanDirectory(basePath, targetPath)
if handle then if handle then
for filePath in handle:lines() do for filePath in handle:lines() do
local fileName = filePath:match("([^/]+)%.lua$") local parts = {}
if fileName and isValidCommand(fileName) then for part in filePath:gsub(".lua$", ""):gmatch("[^/]+") do
table.insert(parts, part)
end
local allValid = true
for _, part in ipairs(parts) do
if not isValidName(part) then
allValid = false
break
end
end
if allValid then
local relPath = filePath:gsub("^"..basePath.."/", ""):gsub(".lua$", ""):gsub("/", ">") local relPath = filePath:gsub("^"..basePath.."/", ""):gsub(".lua$", ""):gsub("/", ">")
table.insert(res, relPath) table.insert(res, relPath)
end end