reformat and add distro check for linux

This commit is contained in:
HorizonCode 2022-12-23 21:41:39 +01:00
parent 7b9a6d77ab
commit 3247a3fcdf

10
app.js
View File

@ -8,6 +8,7 @@ const fs = require('fs');
const rpc = require('./discordPresence'); const rpc = require('./discordPresence');
const windowName = require('get-window-by-name'); const windowName = require('get-window-by-name');
const terminalUtil = require('./terminalUtil'); const terminalUtil = require('./terminalUtil');
const osUtil = require('./osUtil');
let tempOsuPath; let tempOsuPath;
let osuWindowInfo; let osuWindowInfo;
@ -119,6 +120,15 @@ const run = () => {
await tryLogin(mainWindow); await tryLogin(mainWindow);
await doUpdateCheck(mainWindow); await doUpdateCheck(mainWindow);
if (platform === "linux") { if (platform === "linux") {
const linuxDistroInfo = await osUtil.getLinuxDistroInfo();
if (linuxDistroInfo?.id != "arch") {
if (linuxDistroInfo?.id_like != "arch") {
mainWindow.webContents.send('status_update', {
type: "info",
message: "We detected that you are running the Launcher under Linux. It's currently just compatible with Arch like distributions!"
});
}
}
try { try {
await terminalUtil.execCommand(`osu-stable -h`); await terminalUtil.execCommand(`osu-stable -h`);
} catch (err) { } catch (err) {