diff options
author | garret <garret@airmail.cc> | 2022-11-20 08:15:07 +0000 |
---|---|---|
committer | garret <garret@airmail.cc> | 2022-11-20 08:15:07 +0000 |
commit | f45a1d1900a4e200955018859d55834a37aded3b (patch) | |
tree | ed6a6dacb7f9172a90af1df035d482435325890d /make-feed.lua | |
parent | 8a4ef87a52fe1c9dbd454caad251ed0bc39edde4 (diff) | |
download | depctrl-feedmaker-f45a1d1900a4e200955018859d55834a37aded3b.tar.gz depctrl-feedmaker-f45a1d1900a4e200955018859d55834a37aded3b.tar.bz2 depctrl-feedmaker-f45a1d1900a4e200955018859d55834a37aded3b.zip |
feedmaker: fixes
try and output a valid feed
Diffstat (limited to 'make-feed.lua')
-rwxr-xr-x | make-feed.lua | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/make-feed.lua b/make-feed.lua index 1d5c0e2..d8626e5 100755 --- a/make-feed.lua +++ b/make-feed.lua @@ -106,13 +106,9 @@ end local function clean_depctrl(depctrl) local required = {} for _, mod in ipairs(depctrl) do - if type(mod[1]) == "string" then - mod["moduleName"] = mod[1] - mod[1] = nil - else - mod[1]["moduleName"] = mod[1][1] - mod[1][1] = nil - end + if type(mod[1]) ~= "string" then mod = mod[1] end + mod["moduleName"] = mod[1] + mod[1] = nil table.insert(required, mod) end return required @@ -134,7 +130,7 @@ local function make_feed(macros) local macro = {url = config.scriptUrl, author = script.author, name = script.name, description = script.description, channels = {}} local channel_info = {version = script.version, released = script.release, default = true, files = {}} channel_info.requiredModules = clean_depctrl(script.depctrl) - channel_info.files[".lua"] = {name = ".lua", url = config.fileUrl, sha1 = script.sha1} + table.insert(channel_info.files, {name = ".lua", url = config.fileUrl, sha1 = script.sha1}) macro.channels[config.channel] = channel_info feed.macros[script.namespace] = macro end |