From c79d6dd8cacf41031847ad2c8d05782cbefbd9ca Mon Sep 17 00:00:00 2001 From: LordMZTE Date: Thu, 25 Nov 2021 19:55:35 +0100 Subject: [PATCH] fix relations not being included in generated lua manifest --- mpt/assets/modpack.lua.tera | 37 +++++++++++++++++++++++++++++++++++-- 1 file changed, 35 insertions(+), 2 deletions(-) diff --git a/mpt/assets/modpack.lua.tera b/mpt/assets/modpack.lua.tera index 4ffcbd5..a4ff648 100644 --- a/mpt/assets/modpack.lua.tera +++ b/mpt/assets/modpack.lua.tera @@ -33,8 +33,41 @@ manifest = { {% endfor %}},{% endif %}{% endif %} },{% endfor %} }, - },{% endfor %} - }, + }, + relations = { + {% for rel in ver.relations %} { + id = "{{ rel.id }}", + {% if rel.file %}file = { + {% if file.artifact %}installer = "{{ file.installer }}", + artifact = "{{ file.artifact }}", + repository = "{{ file.repository }}",{% else %}{% if file.id %}id = "{{ file.id }}",{% endif %} + installer = "{{ file.installer }}", + link = "{{ file.link }}",{% if file.options %} + options = { + {% for opt in file.options %} "{{ opt }}", + {% endfor %}},{% endif %}{% endif %} + }, + {% endif %}{% if rel.versions %}versions = "{{ rel.versions }}", + {% endif %}{% if rel.meta %}meta = { + name = "{{ rel.meta.name }}", + contributors = { + {% for cont in rel.meta.contributors %} { + name = "{{ cont.name }}", + roles = {% for role in cont.roles %}{ + "{{ role }}", + {% endfor %}}, + {% endfor %}}, + {% if rel.meta.description %}description = "{{ rel.meta.description }}", + {% endif %}{% if rel.meta.icon_url %}icon_url = "{{ rel.meta.icon_url }}", + {% endif %}{% if rel.meta.website_url %}website_url = "{{ rel.meta.website_url }}", + {% endif %}}, + {% endif %}type = "{{ rel.type }}", + options = { + {% for opt in rel.options %} "{{ opt }}", + {% endfor %}}, + },{% endfor %} + }, + },{% endfor %} repositories = { {% for repo in repositories %} { id = "{{ repo.id }}",