From ade31f993b61722c16e97c79bd542a6d111049fc Mon Sep 17 00:00:00 2001 From: V Date: Fri, 12 May 2023 03:41:00 +0200 Subject: Implement plugin tags --- scripts/generatePluginList.ts | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'scripts') diff --git a/scripts/generatePluginList.ts b/scripts/generatePluginList.ts index e4ae20a..8442e42 100644 --- a/scripts/generatePluginList.ts +++ b/scripts/generatePluginList.ts @@ -29,6 +29,7 @@ interface Dev { interface PluginData { name: string; description: string; + tags: string[]; authors: Dev[]; dependencies: string[]; hasPatches: boolean; @@ -106,6 +107,7 @@ async function parseFile(fileName: string) { hasCommands: false, enabledByDefault: false, required: false, + tags: [] as string[] } as PluginData; for (const prop of pluginObj.properties) { @@ -131,6 +133,13 @@ async function parseFile(fileName: string) { return devs[getName(e)!]; }); break; + case "tags": + if (!isArrayLiteralExpression(value)) throw fail("tags is not an array literal"); + data.tags = value.elements.map(e => { + if (!isStringLiteral(e)) throw fail("tags array contains non-string literals"); + return e.text; + }); + break; case "dependencies": if (!isArrayLiteralExpression(value)) throw fail("dependencies is not an array literal"); const { elements } = value; -- cgit