diff options
author | Dominik <dominik.buettner1711@gmail.com> | 2023-01-13 23:24:51 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-13 23:24:51 +0100 |
commit | 6329499b1d589e8c5650565c640ca2a8da41f410 (patch) | |
tree | c0b6bf8cf9809e1c3a9d55e55a97271a108d63fc /src | |
parent | 32cdb6388527c109945c69b4c9edff42033e8a93 (diff) | |
download | Vencord-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')
-rw-r--r-- | src/ipcMain/updater/git.ts | 8 |
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"); } |