Some porting

This commit is contained in:
thororen1234 2024-07-13 00:06:01 -04:00
parent 89c4e489f5
commit ea8c134159
24 changed files with 111 additions and 100 deletions

View file

@ -25,8 +25,8 @@ import { Readable } from "stream";
import { finished } from "stream/promises";
import { fileURLToPath } from "url";
const BASE_URL = "https://github.com/Vencord/Installer/releases/latest/download/";
const INSTALLER_PATH_DARWIN = "VencordInstaller.app/Contents/MacOS/VencordInstaller";
const BASE_URL = "https://github.com/Equicord/Installer/releases/latest/download/";
const INSTALLER_PATH_DARWIN = "EquicordInstaller.app/Contents/MacOS/EquicordInstaller";
const BASE_DIR = join(dirname(fileURLToPath(import.meta.url)), "..");
const FILE_DIR = join(BASE_DIR, "dist", "Installer");
@ -35,11 +35,11 @@ const ETAG_FILE = join(FILE_DIR, "etag.txt");
function getFilename() {
switch (process.platform) {
case "win32":
return "VencordInstallerCli.exe";
return "EquicordInstallerCli.exe";
case "darwin":
return "VencordInstaller.MacOS.zip";
return "EquicordInstaller.MacOS.zip";
case "linux":
return "VencordInstaller-linux";
return "EquicordInstaller-linux";
default:
throw new Error("Unsupported platform: " + process.platform);
}
@ -53,7 +53,7 @@ async function ensureBinary() {
const downloadName = join(FILE_DIR, filename);
const outputFile = process.platform === "darwin"
? join(FILE_DIR, "VencordInstaller")
? join(FILE_DIR, "EquicordInstaller")
: downloadName;
const etag = existsSync(outputFile) && existsSync(ETAG_FILE)
@ -62,7 +62,7 @@ async function ensureBinary() {
const res = await fetch(BASE_URL + filename, {
headers: {
"User-Agent": "Vencord (https://github.com/Vendicated/Vencord)",
"User-Agent": "Equicord (https://github.com/Equicord/Equicord)",
"If-None-Match": etag
}
});
@ -96,7 +96,7 @@ async function ensureBinary() {
execSync(cmd);
} catch { }
};
logAndRun(`sudo spctl --add '${outputFile}' --label "Vencord Installer"`);
logAndRun(`sudo spctl --add '${outputFile}' --label "Equicord Installer"`);
logAndRun(`sudo xattr -d com.apple.quarantine '${outputFile}'`);
} else {
// WHY DOES NODE FETCH RETURN A WEB STREAM OH MY GOD
@ -123,8 +123,8 @@ try {
stdio: "inherit",
env: {
...process.env,
VENCORD_USER_DATA_DIR: BASE_DIR,
VENCORD_DEV_INSTALL: "1"
EQUICORD_USER_DATA_DIR: BASE_DIR,
EQUICORD_DEV_INSTALL: "1"
}
});
} catch {