From f45a1d1900a4e200955018859d55834a37aded3b Mon Sep 17 00:00:00 2001 From: garret Date: Sun, 20 Nov 2022 08:15:07 +0000 Subject: feedmaker: fixes try and output a valid feed --- make-feed.lua | 12 ++++-------- 1 file 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 -- cgit v1.2.3-70-g09d2