diff options
-rw-r--r-- | src/app/main.js | 4 | ||||
-rw-r--r-- | src/utils.js | 19 |
2 files changed, 23 insertions, 0 deletions
diff --git a/src/app/main.js b/src/app/main.js index 17389b2..be13beb 100644 --- a/src/app/main.js +++ b/src/app/main.js @@ -6,6 +6,10 @@ var settings = { gamepath: "", file: "viper.json", zip: "/northstar.zip", + excludes: [ + "ns_startup_args.txt", + "ns_startup_args_dedi.txt" + ] } if (fs.existsSync(settings.file)) { diff --git a/src/utils.js b/src/utils.js index 85cc26e..a5cb461 100644 --- a/src/utils.js +++ b/src/utils.js @@ -18,6 +18,10 @@ var settings = { gamepath: "", file: "viper.json", zip: "/northstar.zip", + excludes: [ + "ns_startup_args.txt", + "ns_startup_args_dedi.txt" + ] } if (fs.existsSync(settings.file)) { @@ -45,6 +49,13 @@ function setpath(win) { } function update() { + for (let i = 0; i < settings.excludes.length; i++) { + let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); + if (fs.existsSync(exclude)) { + fs.renameSync(exclude, exclude + ".excluded") + } + } + console.log("Downloading..."); request({ json: true, @@ -61,6 +72,14 @@ function update() { .on("finish", () => { console.log("Installation/Update finished!"); events.emit("updated"); + + for (let i = 0; i < settings.excludes.length; i++) { + let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); + if (fs.existsSync(exclude + ".excluded")) { + fs.renameSync(exclude + ".excluded", exclude) + } + } + cli.exit(); }); }) |