From 11a630a3c642a8132d97ee8109641b2ed7be6856 Mon Sep 17 00:00:00 2001 From: Jake <134332787+justjxke@users.noreply.github.com> Date: Tue, 27 Jan 2026 23:09:09 +0000 Subject: [PATCH] fix pnpm inject on local builds (#696) --- scripts/runInstaller.mjs | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/scripts/runInstaller.mjs b/scripts/runInstaller.mjs index fee484023..94c03dd4a 100644 --- a/scripts/runInstaller.mjs +++ b/scripts/runInstaller.mjs @@ -27,6 +27,7 @@ import { fileURLToPath } from "url"; const BASE_URL = "https://github.com/Equicord/Equilotl/releases/latest/download/"; const INSTALLER_PATH_DARWIN = "Equilotl.app/Contents/MacOS/Equilotl"; +const INSTALLER_APP_DARWIN = "Equilotl.app"; const BASE_DIR = join(dirname(fileURLToPath(import.meta.url)), ".."); const FILE_DIR = join(BASE_DIR, "dist", "Installer"); @@ -53,8 +54,11 @@ async function ensureBinary() { const downloadName = join(FILE_DIR, filename); const outputFile = process.platform === "darwin" - ? join(FILE_DIR, "Equilotl") + ? join(FILE_DIR, INSTALLER_PATH_DARWIN) : downloadName; + const outputApp = process.platform === "darwin" + ? join(FILE_DIR, INSTALLER_APP_DARWIN) + : null; const etag = existsSync(outputFile) && existsSync(ETAG_FILE) ? readFileSync(ETAG_FILE, "utf-8") @@ -77,17 +81,14 @@ async function ensureBinary() { writeFileSync(ETAG_FILE, res.headers.get("etag")); if (process.platform === "darwin") { - console.log("Unzipping..."); + console.log("Saving zip..."); const zip = new Uint8Array(await res.arrayBuffer()); + writeFileSync(downloadName, zip); - const ff = await import("fflate"); - const bytes = ff.unzipSync(zip, { - filter: f => f.name === INSTALLER_PATH_DARWIN - })[INSTALLER_PATH_DARWIN]; + console.log("Unzipping app bundle..."); + execSync(`ditto -x -k '${downloadName}' '${FILE_DIR}'`); - writeFileSync(outputFile, bytes, { mode: 0o755 }); - - console.log("Overriding security policy for installer binary (this is required to run it)"); + console.log("Clearing quarantine from installer app (this is required to run it)"); console.log("xattr might error, that's okay"); const logAndRun = cmd => { @@ -96,8 +97,7 @@ async function ensureBinary() { execSync(cmd); } catch { } }; - logAndRun(`sudo spctl --add '${outputFile}' --label "Equilotl"`); - logAndRun(`sudo xattr -d com.apple.quarantine '${outputFile}'`); + logAndRun(`sudo xattr -dr com.apple.quarantine '${outputApp}'`); } else { // WHY DOES NODE FETCH RETURN A WEB STREAM OH MY GOD const body = Readable.fromWeb(res.body);