aboutsummaryrefslogtreecommitdiff
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
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>
-rw-r--r--.gitignore1
-rw-r--r--src/ipcMain/updater/git.ts8
2 files changed, 6 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore
index 7bd751c..135673a 100644
--- a/.gitignore
+++ b/.gitignore
@@ -5,6 +5,7 @@ node_modules
vencord_installer
.idea
+.DS_Store
yarn.lock
package-lock.json
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");
}