aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2021-12-28 22:49:11 +0100
committerAlystrasz <contact@remyraes.com>2021-12-28 22:49:11 +0100
commit30fc024406227c89dc3c6d5a067f21a991d1e20c (patch)
tree367a3c7e3752f2c4c9c0bf047e4e300c355ee536
parent810176c592c5cc071dd8ca14ed9519b38e1c96d9 (diff)
downloadViper-30fc024406227c89dc3c6d5a067f21a991d1e20c.tar.gz
Viper-30fc024406227c89dc3c6d5a067f21a991d1e20c.zip
[feat] latest update is not downloaded if it's already installed
-rw-r--r--src/utils.js12
1 files changed, 9 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js
index a6be21d..c5bf05e 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -65,9 +65,8 @@ function update() {
}
}
- console.log("Downloading...");
+ console.log("Checking for updates...");
const version = getNorthstarInstalledVersion();
- console.log(version);
request({
json: true,
@@ -75,7 +74,14 @@ function update() {
url: "https://api.github.com/repos/R2Northstar/Northstar/releases/latest",
}, (error, response, body) => {
const tag = body['tag_name'];
- console.log(tag);
+
+ console.log('current version:', version);
+ console.log('remote version:', tag);
+
+ if (version === tag) {
+ console.log('Latest version is already installed, skipping update.');
+ return;
+ }
https.get(body.assets[0].browser_download_url, (res) => {
let stream = fs.createWriteStream(settings.zip);