aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2021-12-27 02:13:32 +0100
committer0neGal <mail@0negal.com>2021-12-27 02:13:32 +0100
commit9d438e3f8f543a93a916f0573c0ea24dbaf4a395 (patch)
tree58b5544ac81f13f070462458342a78239b38ec04 /src/utils.js
parent6ac8259ec96db1ac0e770dd42b4f21c2eabd5c63 (diff)
downloadViper-9d438e3f8f543a93a916f0573c0ea24dbaf4a395.tar.gz
Viper-9d438e3f8f543a93a916f0573c0ea24dbaf4a395.zip
this might add launch options? maybe?
I haven't tested this on Windows... And I will in a bit...
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
index 5394894..c60eb5e 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -9,6 +9,7 @@ const cli = require("./cli");
const unzip = require("unzipper");
const request = require("request");
+const exec = require("child_process").spawn;
const { https } = require("follow-redirects");
process.chdir(app.getPath("appData"));
@@ -65,7 +66,26 @@ function update() {
})
}
+function launch(version) {
+ if (process.platform == "linux") {
+ console.error("error: Launching the game is not currently supported on Linux")
+ cli.exit(1);
+ }
+
+ switch(version) {
+ case "vanilla":
+ console.log("Launching Vanilla...")
+ exec(path.join(settings.gamepath + "/Titanfall2.exe"))
+ break;
+ default:
+ console.log("Launching Northstar...")
+ exec(path.join(settings.gamepath + "/NorthstarLauncher.exe"))
+ break;
+ }
+}
+
module.exports = {
+ launch,
update,
setpath,
settings,