From cb2fb648b6c82826cfab7781993cec0e6616304e Mon Sep 17 00:00:00 2001 From: Vendicated Date: Sun, 9 Apr 2023 03:10:24 +0200 Subject: [PATCH] Fix file downloader --- src/main/utils/vencordLoader.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/src/main/utils/vencordLoader.ts b/src/main/utils/vencordLoader.ts index 7248884..8964604 100644 --- a/src/main/utils/vencordLoader.ts +++ b/src/main/utils/vencordLoader.ts @@ -3,7 +3,6 @@ import { join } from "path"; import { USER_AGENT, VENCORD_FILES_DIR } from "../constants"; import { downloadFile, simpleGet } from "./http"; -// TODO: Setting to switch repo const API_BASE = "https://api.github.com/repos/Vendicated/Vencord"; const FILES_TO_DOWNLOAD = [ @@ -33,21 +32,17 @@ export async function downloadVencordFiles() { await Promise.all( assets - .filter(({ name }) => FILES_TO_DOWNLOAD.some(f => name.startsWith(f))) + .filter(({ name }) => + FILES_TO_DOWNLOAD.some(f => name.startsWith(f)) + ) .map(({ name, browser_download_url }) => - downloadFile( - browser_download_url, - join( - VENCORD_FILES_DIR, - name.replace(/vencordDesktop(\w)/, (_, c) => c.toLowerCase()) - ) - ) + downloadFile(browser_download_url, join(VENCORD_FILES_DIR, name)) ) ); } export async function ensureVencordFiles() { - if (existsSync(join(VENCORD_FILES_DIR, "main.js"))) return; + if (existsSync(join(VENCORD_FILES_DIR, "vencordDesktopMain.js"))) return; mkdirSync(VENCORD_FILES_DIR, { recursive: true }); await downloadVencordFiles();