diff options
author | 0neGal <mail@0negal.com> | 2021-12-31 16:59:48 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2021-12-31 16:59:48 +0100 |
commit | 67b32b527aec8d36a4b6cca14677febc46f0e26d (patch) | |
tree | 47691134760f1cab6b9f7acbfb26a48d78326643 /src/utils.js | |
parent | c5c63d6c8a81596d0dcf3e14e072ea14f4d0610c (diff) | |
parent | ba82a7e8e5bc90705649c859674caeb334996b81 (diff) | |
download | Viper-67b32b527aec8d36a4b6cca14677febc46f0e26d.tar.gz Viper-67b32b527aec8d36a4b6cca14677febc46f0e26d.zip |
Merge branch 'main' of 0neGal/viper into mod-support
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 8bc6440..ba710dc 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]); @@ -173,6 +174,7 @@ module.exports = { update, setpath, settings, + getNSVersion, setlang: (lang) => { settings.lang = lang; saveSettings(); |