aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2021-12-28 22:37:18 +0100
committerAlystrasz <contact@remyraes.com>2021-12-28 22:37:18 +0100
commite9bd16e8cee14b983bad23cbae088794bb80349d (patch)
treec7a0b134d1a632f2c78b23f96d54fe3a20d81393
parentb967b24e550e2e3576ddbe20de315eec3e7209cf (diff)
downloadViper-e9bd16e8cee14b983bad23cbae088794bb80349d.tar.gz
Viper-e9bd16e8cee14b983bad23cbae088794bb80349d.zip
[feat] storing local northstar version in viper.json
-rw-r--r--src/utils.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
index 376c03c..e7e118d 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -17,6 +17,7 @@ process.chdir(app.getPath("appData"));
var settings = {
gamepath: "",
zip: "/northstar.zip",
+ northstarVersion: "unknown",
excludes: [
"ns_startup_args.txt",
"ns_startup_args_dedi.txt"
@@ -47,6 +48,11 @@ function setpath(win) {
cli.exit();
}
+function getNorthstarInstalledVersion() {
+ const configFilePath = app.getPath("appData") + "/viper.json";
+ return JSON.parse(fs.readFileSync(configFilePath, "utf8"))['northstarVersion'];
+}
+
function update() {
for (let i = 0; i < settings.excludes.length; i++) {
let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]);
@@ -56,6 +62,9 @@ function update() {
}
console.log("Downloading...");
+ const version = getNorthstarInstalledVersion();
+ console.log(version);
+
request({
json: true,
headers: {"User-Agent": "Viper"},