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