From 9d5498708b1b7db82fae53b4c858de7e43f21c95 Mon Sep 17 00:00:00 2001 From: 0neGal Date: Wed, 29 Dec 2021 00:00:27 +0100 Subject: removed updateInstalledVersion() I'm not quite sure what the purpose of this function is considering we only use it once, and there's not much reason to export it or anything. --- src/utils.js | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/utils.js b/src/utils.js index 3bad620..5ae535f 100644 --- a/src/utils.js +++ b/src/utils.js @@ -61,9 +61,6 @@ function getInstalledVersion() { return "unknown"; } } -function updateInstalledVersion(newTag) { - fs.writeFileSync(path.join(settings.gamepath, "ns_version.txt"), newTag); -} function update() { for (let i = 0; i < settings.excludes.length; i++) { @@ -81,7 +78,7 @@ function update() { headers: {"User-Agent": "Viper"}, url: "https://api.github.com/repos/R2Northstar/Northstar/releases/latest", }, (error, response, body) => { - const tag = body["tag_name"]; + var tag = body["tag_name"]; console.log("current version:", version); console.log("remote version:", tag); @@ -101,7 +98,7 @@ function update() { .on("finish", () => { console.log("Installation/Update finished!"); - updateInstalledVersion(tag); + fs.writeFileSync(path.join(settings.gamepath, "ns_version.txt"), tag); events.emit("updated"); -- cgit v1.2.3