reformat and add distro check for linux
This commit is contained in:
parent
7b9a6d77ab
commit
3247a3fcdf
22
app.js
22
app.js
|
@ -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;
|
||||||
|
@ -40,7 +41,7 @@ const run = () => {
|
||||||
const splitArray = [components.shift(), components.join(' - ')];
|
const splitArray = [components.shift(), components.join(' - ')];
|
||||||
rpcOsuVersion = splitArray[0];
|
rpcOsuVersion = splitArray[0];
|
||||||
currentMap = splitArray[1];
|
currentMap = splitArray[1];
|
||||||
if(currentMap.endsWith(".osu")){
|
if (currentMap.endsWith(".osu")) {
|
||||||
rpc.updateState("Editing...");
|
rpc.updateState("Editing...");
|
||||||
currentMap = currentMap.substring(0, currentMap.length - 4);
|
currentMap = currentMap.substring(0, currentMap.length - 4);
|
||||||
} else rpc.updateState("Playing...");
|
} else rpc.updateState("Playing...");
|
||||||
|
@ -82,10 +83,10 @@ const run = () => {
|
||||||
const splitArray = [components.shift(), components.join(' - ')];
|
const splitArray = [components.shift(), components.join(' - ')];
|
||||||
rpcOsuVersion = splitArray[0];
|
rpcOsuVersion = splitArray[0];
|
||||||
currentMap = splitArray[1];
|
currentMap = splitArray[1];
|
||||||
if(currentMap.endsWith(".osu")){
|
if (currentMap.endsWith(".osu")) {
|
||||||
rpc.updateState("Editing...");
|
rpc.updateState("Editing...");
|
||||||
currentMap = currentMap.substring(0, currentMap.length - 4);
|
currentMap = currentMap.substring(0, currentMap.length - 4);
|
||||||
}
|
}
|
||||||
else rpc.updateState("Playing...");
|
else rpc.updateState("Playing...");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,9 +120,18 @@ const run = () => {
|
||||||
await tryLogin(mainWindow);
|
await tryLogin(mainWindow);
|
||||||
await doUpdateCheck(mainWindow);
|
await doUpdateCheck(mainWindow);
|
||||||
if (platform === "linux") {
|
if (platform === "linux") {
|
||||||
try{
|
const linuxDistroInfo = await osUtil.getLinuxDistroInfo();
|
||||||
await terminalUtil.execCommand(`osu-stable -h`);
|
if (linuxDistroInfo?.id != "arch") {
|
||||||
}catch(err){
|
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 {
|
||||||
|
await terminalUtil.execCommand(`osu-stable -h`);
|
||||||
|
} catch (err) {
|
||||||
mainWindow.webContents.send('status_update', {
|
mainWindow.webContents.send('status_update', {
|
||||||
type: "package-issue",
|
type: "package-issue",
|
||||||
message: "Seems like you dont have the osu AUR Package installed, please install it."
|
message: "Seems like you dont have the osu AUR Package installed, please install it."
|
||||||
|
|
Loading…
Reference in New Issue
Block a user