aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
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,