aboutsummaryrefslogtreecommitdiff
path: root/scripts/generatePluginList.ts
diff options
context:
space:
mode:
authorV <vendicated@riseup.net>2023-09-22 04:48:54 +0200
committerV <vendicated@riseup.net>2023-09-22 04:48:54 +0200
commitcfca393f2be3edcd832dc2194f7022164f4ea857 (patch)
tree2d4b411c61adb5e8152750766cc55ee7d203a1e1 /scripts/generatePluginList.ts
parenteacc673bcc84abba39b17f7fd99b18127478f130 (diff)
downloadVencord-cfca393f2be3edcd832dc2194f7022164f4ea857.tar.gz
Vencord-cfca393f2be3edcd832dc2194f7022164f4ea857.tar.bz2
Vencord-cfca393f2be3edcd832dc2194f7022164f4ea857.zip
ci(generatePluginList): add filePath
Diffstat (limited to 'scripts/generatePluginList.ts')
-rw-r--r--scripts/generatePluginList.ts10
1 files changed, 9 insertions, 1 deletions
diff --git a/scripts/generatePluginList.ts b/scripts/generatePluginList.ts
index b788178..e8aa33a 100644
--- a/scripts/generatePluginList.ts
+++ b/scripts/generatePluginList.ts
@@ -18,7 +18,8 @@
import { Dirent, readdirSync, readFileSync, writeFileSync } from "fs";
import { access, readFile } from "fs/promises";
-import { join } from "path";
+import { join, sep } from "path";
+import { normalize as posixNormalize, sep as posixSep } from "path/posix";
import { BigIntLiteral, createSourceFile, Identifier, isArrayLiteralExpression, isCallExpression, isExportAssignment, isIdentifier, isObjectLiteralExpression, isPropertyAccessExpression, isPropertyAssignment, isSatisfiesExpression, isStringLiteral, isVariableStatement, NamedDeclaration, NodeArray, ObjectLiteralExpression, ScriptTarget, StringLiteral, SyntaxKind } from "typescript";
import { getPluginTarget } from "./utils.mjs";
@@ -39,6 +40,7 @@ interface PluginData {
required: boolean;
enabledByDefault: boolean;
target: "discordDesktop" | "vencordDesktop" | "web" | "dev";
+ filePath: string;
}
const devs = {} as Record<string, Dev>;
@@ -165,6 +167,12 @@ async function parseFile(fileName: string) {
data.target = target as any;
}
+ data.filePath = posixNormalize(fileName)
+ .split(sep)
+ .join(posixSep)
+ .replace(/\/index\.([jt]sx?)$/, "")
+ .replace(/^src\/plugins\//, "");
+
let readme = "";
try {
readme = readFileSync(join(fileName, "..", "README.md"), "utf-8");