diff options
author | 0neGal <mail@0negal.com> | 2021-12-31 15:40:32 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2021-12-31 15:40:32 +0100 |
commit | 4f798d07731668f0e850b7d348de74bf6f422de0 (patch) | |
tree | 8e530838e0bf8826f48dd570d17ca917c22e622e /src/utils.js | |
parent | c8fec42e085ef255a01f62c5010e2d41bb7eb05f (diff) | |
parent | 10c786da5be323c0b2e7042e79bcee8849e25ef4 (diff) | |
download | Viper-4f798d07731668f0e850b7d348de74bf6f422de0.tar.gz Viper-4f798d07731668f0e850b7d348de74bf6f422de0.zip |
Merge branch 'Alystrasz-feat/version-indicator'
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js index b4ff04d..06acbdf 100644 --- a/src/utils.js +++ b/src/utils.js @@ -52,8 +52,8 @@ function saveSettings() { fs.writeFileSync(app.getPath("appData") + "/viper.json", JSON.stringify(settings)); } -function getInstalledVersion() { - const versionFilePath = path.join(settings.gamepath, "ns_version.txt"); +function getNSVersion() { + var versionFilePath = path.join(settings.gamepath, "ns_version.txt"); if (fs.existsSync(versionFilePath)) { return fs.readFileSync(versionFilePath, "utf8"); @@ -73,7 +73,7 @@ function update() { ipcMain.emit("ns-updating"); console.log(lang("cli.update.checking")); - const version = getInstalledVersion(); + var version = getNSVersion(); request({ json: true, @@ -106,6 +106,7 @@ function update() { fs.createReadStream(settings.zip).pipe(unzip.Extract({path: settings.gamepath})) .on("finish", () => { fs.writeFileSync(path.join(settings.gamepath, "ns_version.txt"), tag); + ipcMain.emit("getversion"); for (let i = 0; i < settings.excludes.length; i++) { let exclude = path.join(settings.gamepath + "/" + settings.excludes[i]); @@ -153,6 +154,7 @@ module.exports = { update, setpath, settings, + getNSVersion, setlang: (lang) => { settings.lang = lang; saveSettings(); |