aboutsummaryrefslogtreecommitdiff
path: root/src/ipcMain/updater
diff options
context:
space:
mode:
authorDominik <dominik.buettner1711@gmail.com>2023-01-13 23:24:51 +0100
committerGitHub <noreply@github.com>2023-01-13 23:24:51 +0100
commit6329499b1d589e8c5650565c640ca2a8da41f410 (patch)
treec0b6bf8cf9809e1c3a9d55e55a97271a108d63fc /src/ipcMain/updater
parent32cdb6388527c109945c69b4c9edff42033e8a93 (diff)
downloadVencord-6329499b1d589e8c5650565c640ca2a8da41f410.tar.gz
Vencord-6329499b1d589e8c5650565c640ca2a8da41f410.tar.bz2
Vencord-6329499b1d589e8c5650565c640ca2a8da41f410.zip
git updater: Fix macOS (#391)
Co-authored-by: Ven <vendicated@riseup.net>
Diffstat (limited to 'src/ipcMain/updater')
-rw-r--r--src/ipcMain/updater/git.ts8
1 files changed, 5 insertions, 3 deletions
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");
}