From 30a87fdb4ced57c7f1ae9dbfafb8308bb62e51e6 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 1 Aug 2025 12:53:25 +0300 Subject: [PATCH] update List.lua --- com/List.lua | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/com/List.lua b/com/List.lua index 5de32cd..547a9b5 100644 --- a/com/List.lua +++ b/com/List.lua @@ -10,7 +10,7 @@ if In.Params and In.Params.about then return end -local function isValidCommand(name) +local function isValidName(name) return name:match("^[%w]+$") ~= nil end @@ -21,8 +21,20 @@ local function scanDirectory(basePath, targetPath) if handle then for filePath in handle:lines() do - local fileName = filePath:match("([^/]+)%.lua$") - if fileName and isValidCommand(fileName) then + local parts = {} + 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("/", ">") table.insert(res, relPath) end