This commit is contained in:
Robert Jelic
2025-02-21 18:46:03 +01:00
parent 792832c61d
commit 78ca4a1a04
3 changed files with 23 additions and 19 deletions

View File

@@ -133,7 +133,7 @@ versionDropdown:onSelect(function(self, index, value)
end
end)
instalScreen:addLabel(coloring)
installScreen:addLabel(coloring)
:setText("Path:")
:setPosition(2, "{versionDesc.y + versionDesc.height + 1}")

View File

@@ -1,5 +1,7 @@
local VisualElement = require("elements/VisualElement")
local tHex = require("libraries/colorHex")
---@configDescription A multi-line text editor component with cursor support and text manipulation features
---@configDefault false
---A multi-line text editor component with cursor support and text manipulation features
---@class TextBox : VisualElement

View File

@@ -74,34 +74,36 @@ local function categorizeFile(path)
end
end
local function scanDirectory(baseDir, relativePath)
local function scanDirectory(baseDir)
local files = {}
-- Liste aller zu scannenden Ordner
local dirs = {
baseDir .. "/elements",
baseDir .. "/plugins",
baseDir .. "/libraries",
baseDir -- für Core-Files
}
-- Nutze direkt io.popen für das Directory Listing
local cmd = 'dir "' .. baseDir .. '/' .. relativePath .. '" /b /s'
local pipe = io.popen(cmd)
if not pipe then
error("Failed to execute directory scan command")
return files
end
for path in pipe:lines() do
if path:match("%.lua$") then
local config = parseFile(path)
if config then
config.name = path:match("([^/\\]+)%.lua$")
config.path = path:gsub(baseDir .. "/", "")
files[path] = config
for _, dir in ipairs(dirs) do
for entry in io.popen('ls -1 "' .. dir .. '"'):lines() do
if entry:match("%.lua$") then
local fullPath = dir .. "/" .. entry
local config = parseFile(fullPath)
if config then
config.name = entry:gsub("%.lua$", "")
-- Relativen Pfad erstellen
config.path = fullPath:gsub("^" .. baseDir .. "/", "")
files[fullPath] = config
end
end
end
end
pipe:close()
return files
end
local function generateConfig(srcPath)
local files = scanDirectory(srcPath, "")
local files = scanDirectory(srcPath)
local categories = {}
-- Files in Kategorien einordnen