aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2021-12-31 16:59:48 +0100
committer0neGal <mail@0negal.com>2021-12-31 16:59:48 +0100
commit67b32b527aec8d36a4b6cca14677febc46f0e26d (patch)
tree47691134760f1cab6b9f7acbfb26a48d78326643 /src/utils.js
parentc5c63d6c8a81596d0dcf3e14e072ea14f4d0610c (diff)
parentba82a7e8e5bc90705649c859674caeb334996b81 (diff)
downloadViper-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.js8
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();