Skip to content

Commit 23cbcda

Browse files
committed
API generator runs one generator instead of all;
Currently running one is more convenient/useful. Can always add back ability to run all of them in the future.
1 parent d13ea30 commit 23cbcda

File tree

2 files changed

+8
-11
lines changed

2 files changed

+8
-11
lines changed

.github/workflows/generate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ jobs:
3232
run: curl -sOL https://lovr.org/f/lovr-x86_64.AppImage && chmod +x lovr-x86_64.AppImage
3333

3434
- name: Generate
35-
run: ./lovr-x86_64.AppImage docs/api
35+
run: ./lovr-x86_64.AppImage docs/api cats
3636

3737
- name: Format
3838
run: |

api/main.lua

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -491,16 +491,13 @@ function lovr.load()
491491
table.sort(api.modules, function(a, b) return a.key < b.key end)
492492
table.sort(api.callbacks, function(a, b) return a.key < b.key end)
493493

494-
-- Run generators
495-
for i, file in ipairs(lovr.filesystem.getDirectoryItems('generators')) do
496-
local name = file:gsub('%.lua$', '')
497-
local ok, generator = pcall(require, 'generators.' .. name)
498-
499-
if not ok then
500-
print(('Could not load generator %q: %s'):format(name, generator))
501-
elseif not arg[1] or arg[1] == name then
502-
generator(api)
503-
end
494+
-- Generate
495+
local ok, generator = pcall(require, 'generators.' .. (arg[1] or 'lua'))
496+
497+
if not ok then
498+
print(('Could not load generator %q: %s'):format(name, generator))
499+
else
500+
generator(api)
504501
end
505502

506503
-- Bye

0 commit comments

Comments
 (0)