From 6329499b1d589e8c5650565c640ca2a8da41f410 Mon Sep 17 00:00:00 2001 From: Dominik Date: Fri, 13 Jan 2023 23:24:51 +0100 Subject: git updater: Fix macOS (#391) Co-authored-by: Ven --- src/ipcMain/updater/git.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src/ipcMain/updater/git.ts') diff --git a/src/ipcMain/updater/git.ts b/src/ipcMain/updater/git.ts index 20cc5b1..e787b8f 100644 --- a/src/ipcMain/updater/git.ts +++ b/src/ipcMain/updater/git.ts @@ -30,6 +30,8 @@ const execFile = promisify(cpExecFile); const isFlatpak = Boolean(process.env.FLATPAK_ID?.includes("discordapp") || process.env.FLATPAK_ID?.includes("Discord")); +if (process.platform === "darwin") process.env.PATH = `/usr/local/bin:${process.env.PATH}`; + function git(...args: string[]) { const opts = { cwd: VENCORD_SRC_DIR }; @@ -66,10 +68,10 @@ async function pull() { async function build() { const opts = { cwd: VENCORD_SRC_DIR }; - let res; + const command = isFlatpak ? "flatpak-spawn" : "node"; + const args = isFlatpak ? ["--host", "node", "scripts/build/build.mjs"] : ["scripts/build/build.mjs"]; - if (isFlatpak) res = await execFile("flatpak-spawn", ["--host", "node", "scripts/build/build.mjs"], opts); - else res = await execFile("node", ["scripts/build/build.mjs"], opts); + const res = await execFile(command, args, opts); return !res.stderr.includes("Build failed"); } -- cgit