diff options
author | B <fitnessnonsense@gmail.com> | 2022-06-01 13:38:12 -0600 |
---|---|---|
committer | B <fitnessnonsense@gmail.com> | 2022-06-01 13:38:12 -0600 |
commit | e0f0ff86338e48a97fed152eca20d9497730e9d4 (patch) | |
tree | 1382151864be76349af40786f2d7e05f99adfb8a | |
parent | 461ad2c4183f47c089f307e21acc0c2316874243 (diff) | |
download | Viper-e0f0ff86338e48a97fed152eca20d9497730e9d4.tar.gz Viper-e0f0ff86338e48a97fed152eca20d9497730e9d4.zip |
added origin check
-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 |