use unpacked in dev

This commit is contained in:
Vendicated
2024-07-19 21:52:49 +02:00
parent 94a0c4dc10
commit ac28db6c4d
4 changed files with 11 additions and 13 deletions

View File

@@ -7,7 +7,7 @@
import { existsSync } from "fs";
import { join } from "path";
import { USER_AGENT, VENCORD_ASAR_FILE } from "../constants";
import { USER_AGENT, VENCORD_DIR } from "../constants";
import { downloadFile, fetchie } from "./http";
const API_BASE = "https://api.github.com";
@@ -38,18 +38,18 @@ export async function githubGet(endpoint: string) {
export async function downloadVencordAsar() {
await downloadFile(
"https://github.com/Vendicated/Vencord/releases/latest/download/vesktop.asar",
VENCORD_ASAR_FILE,
VENCORD_DIR,
{},
{ retryOnNetworkError: true }
);
}
export function isValidVencordInstall(dir: string) {
return existsSync(join(dir, "vesktop.asar"));
return existsSync(join(dir, "vesktop/main.js"));
}
export async function ensureVencordFiles() {
if (existsSync(VENCORD_ASAR_FILE)) return;
if (existsSync(VENCORD_DIR)) return;
await downloadVencordAsar();
}