diff options
author | 0neGal <mail@0negal.com> | 2023-03-05 00:52:49 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-03-05 00:52:49 +0100 |
commit | a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a (patch) | |
tree | e058daee9677f5820d3130f08a34cb9ccfd8442e /src/modules/is_running.js | |
parent | 5d86a3daa5f762326055469b6bcd8346e0655056 (diff) | |
download | Viper-a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a.tar.gz Viper-a5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a.zip |
show alert when updating with game running
This also fixes is_running not quite working on Linux
Diffstat (limited to 'src/modules/is_running.js')
-rw-r--r-- | src/modules/is_running.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/src/modules/is_running.js b/src/modules/is_running.js index cc91ded..5e0b67e 100644 --- a/src/modules/is_running.js +++ b/src/modules/is_running.js @@ -20,7 +20,7 @@ async function check_processes(processes) { // thing. And it's not much more clunky. let cmd = (() => { switch (process.platform) { - case "linux": return "ps -A"; + case "linux": return "ps a"; case "win32": return "tasklist"; } })(); @@ -28,37 +28,39 @@ async function check_processes(processes) { exec(cmd, (err, stdout) => { for (let i = 0; i < processes.length; i++) { if (stdout.includes(processes[i])) { + console.log("running") resolve(true); break } + console.log("not running") if (i == processes.length - 1) {resolve(false)} } }); }); } -is_running.game = async () => { - return await check_processes([ +is_running.game = () => { + return check_processes([ "NorthstarLauncher.exe", "Titanfall2.exe", "Titanfall2-unpacked.exe" ]) } -is_running.origin = async () => { - return await check_processes([ +is_running.origin = () => { + return check_processes([ "Origin.exe", ]) } -is_running.titanfall = async () => { - return await check_processes([ +is_running.titanfall = () => { + return check_processes([ "Titanfall2.exe", "Titanfall2-unpacked.exe" ]) } -is_running.northstar = async () => { - return await check_processes([ +is_running.northstar = () => { + return check_processes([ "NorthstarLauncher.exe", ]) } |