diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils.js | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js index b69a9a2..d67792a 100644 --- a/src/utils.js +++ b/src/utils.js @@ -101,6 +101,28 @@ async function isGameRunning() { }); } +async function isOriginRunning() { + return new Promise(resolve => { + let procs = ["origin.exe"]; //check this, probably not right + let cmd = (() => { + switch (process.platform) { + case "linux": return "ps -A"; + case "win32": return "tasklist"; + } + })(); + + exec(cmd, (err, stdout) => { + procs.forEach( proc => { + if (stdout.includes(proc)) { + resolve(true); + return; + } + resolve(false); + }); + }); + }); +} + // Handles auto updating Northstar. // // It uses isGameRunning() to ensure it doesn't run while the game is |