Skip to content

Commit

Permalink
fix: appimage not relaunching (#128)
Browse files Browse the repository at this point in the history
  • Loading branch information
zyrouge committed Sep 27, 2023
1 parent ef064eb commit 670de01
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/ipc.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
* Copyright (c) 2023 Vendicated and Vencord contributors
*/

import { app, dialog, session, shell } from "electron";
import { execFile } from "child_process";
import { app, dialog, RelaunchOptions, session, shell } from "electron";
import { mkdirSync, readFileSync, watch } from "fs";
import { open, readFile } from "fs/promises";
import { release } from "os";
Expand Down Expand Up @@ -45,7 +46,14 @@ handle(IpcEvents.SET_SETTINGS, (_, settings: typeof Settings.store, path?: strin
});

handle(IpcEvents.RELAUNCH, () => {
app.relaunch();
const options: RelaunchOptions = {
args: process.argv.slice(1).concat(["--relaunch"])
};
if (app.isPackaged && process.env.APPIMAGE) {
execFile(process.env.APPIMAGE, options.args);
} else {
app.relaunch(options);
}
app.exit();
});

Expand Down

0 comments on commit 670de01

Please sign in to comment.