From 6d9ed5efa1d32179a20039d869d292fb4d9d3af2 Mon Sep 17 00:00:00 2001 From: Robert Jelic <36573031+NoryiE@users.noreply.github.com> Date: Sun, 16 Feb 2025 15:23:10 +0100 Subject: [PATCH] Test --- .github/workflows/main.yml | 5 +++-- src/main.lua | 1 - tools/generate-config.lua | 13 ++++++------- 3 files changed, 9 insertions(+), 10 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 2059883..7004ef4 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -27,7 +27,8 @@ jobs: # Step 1: Config Generation - name: Generate Config run: | - lua tools/generate-config.lua + cd $GITHUB_WORKSPACE + lua tools/annotationParser.lua src/elements src/LuaLS.lua # Step 2: Generate LuaLS Definitions - name: Generate LuaLS @@ -69,6 +70,6 @@ jobs: run: | git config --global user.name 'github-actions[bot]' git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' - git add config.lua src/LuaLS.lua release/basalt.lua CHANGELOG.md + git add config.lua "src/LuaLS.lua" release/basalt.lua CHANGELOG.md git commit -m "Update config, LuaLS definitions, bundle and changelog" || exit 0 git push \ No newline at end of file diff --git a/src/main.lua b/src/main.lua index c801db1..0a28916 100644 --- a/src/main.lua +++ b/src/main.lua @@ -201,5 +201,4 @@ function basalt.getAPI(name) return elementManager.getAPI(name) end - return basalt \ No newline at end of file diff --git a/tools/generate-config.lua b/tools/generate-config.lua index e28ddc2..1c813b1 100644 --- a/tools/generate-config.lua +++ b/tools/generate-config.lua @@ -25,13 +25,12 @@ end local function scanDir(dir) local files = {} for file in io.popen('find "'..dir..'" -type f -name "*.lua"'):lines() do - local f = io.open(file, "r") - if f then - local content = f:read("*all") - f:close() - -- Entferne den src/ Prefix vom Pfad für die Config - local configPath = file:gsub("^src/", "") - files[configPath] = content + local name = file:match("([^/]+)%.lua$") + if name then + files[file] = { + name = name, + path = file:gsub("^src/", ""), + } end end return files