diff options
author | V <vendicated@riseup.net> | 2023-05-12 03:41:00 +0200 |
---|---|---|
committer | V <vendicated@riseup.net> | 2023-05-12 03:41:15 +0200 |
commit | ade31f993b61722c16e97c79bd542a6d111049fc (patch) | |
tree | a5f48a634bae2ae4e0bc31fb6a6f324d333a7da1 /scripts/generatePluginList.ts | |
parent | 3c7496ac6d72534c9b285ac789d95a4040a7385c (diff) | |
download | Vencord-ade31f993b61722c16e97c79bd542a6d111049fc.tar.gz Vencord-ade31f993b61722c16e97c79bd542a6d111049fc.tar.bz2 Vencord-ade31f993b61722c16e97c79bd542a6d111049fc.zip |
Implement plugin tags
Diffstat (limited to 'scripts/generatePluginList.ts')
-rw-r--r-- | scripts/generatePluginList.ts | 9 |
1 files changed, 9 insertions, 0 deletions
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; |