From dcf543b4f81b58cb4454b6eec1e1e9e7728cd6e9 Mon Sep 17 00:00:00 2001 From: ObiYKenobi Date: Mon, 22 Sep 2025 19:45:25 -0400 Subject: [PATCH] made directory mode recursive --- detector.luau | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/detector.luau b/detector.luau index df005ef..ffbf8cd 100644 --- a/detector.luau +++ b/detector.luau @@ -111,13 +111,19 @@ if directoryMode then end -- read directory and collect .rbxm and .rbxmx files - for _, file in pairs(fs.readDir(directoryPath)) do - local fullPath = directoryPath .. "/" .. file - if fs.isFile(fullPath) and isValidModelFile(file) then - table.insert(filesToProcess, fullPath) - end - end + local function readDirLoop(dirPath) + for _, file in pairs(fs.readDir(dirPath)) do + local fullPath = dirPath .. "/" .. file + if fs.isFile(fullPath) and isValidModelFile(file) then + table.insert(filesToProcess, fullPath) + elseif fs.isDir(fullPath) then + readDirLoop(fullPath) + end + end + end + readDirLoop(directoryPath) + if #filesToProcess == 0 then stdio.write(stdio.color("yellow")) stdio.write(`Warning: No .rbxm or .rbxmx files found in directory {directoryPath}.\n`)