isValidVencordInstall: don't require package.json to exist

This commit is contained in:
Vendicated
2026-08-24 18:42:39 +02:00
parent 667768c433
commit 50652cdd89
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -149,7 +149,7 @@ handle(IpcEvents.SELECT_VENCORD_DIR, async (_e, value?: null) => {
if (!res.filePaths.length) return "cancelled"; if (!res.filePaths.length) return "cancelled";
const dir = res.filePaths[0]; const dir = res.filePaths[0];
if (!isValidVencordInstall(dir)) return "invalid"; if (!(await isValidVencordInstall(dir))) return "invalid";
State.store.vencordDir = dir; State.store.vencordDir = dir;
+1 -1
View File
@@ -64,7 +64,7 @@ const existsAsync = (path: string) =>
.catch(() => false); .catch(() => false);
export async function isValidVencordInstall(dir: string) { export async function isValidVencordInstall(dir: string) {
const results = await Promise.all(["package.json", ...FILES_TO_DOWNLOAD].map(f => existsAsync(join(dir, f)))); const results = await Promise.all(FILES_TO_DOWNLOAD.map(f => existsAsync(join(dir, f))));
return !results.includes(false); return !results.includes(false);
} }