aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlystrasz <contact@remyraes.com>2022-01-08 18:59:50 +0100
committerAlystrasz <contact@remyraes.com>2022-01-08 18:59:50 +0100
commite8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b (patch)
treea8a6692d538ea0ad1a4d7962140b63d2a62952ce
parent61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4 (diff)
downloadViper-e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b.tar.gz
Viper-e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b.zip
[feat] checking every 15 minutes for new Northstar version
-rw-r--r--src/utils.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
index 68cd6c1..38aaf85 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -34,6 +34,24 @@ if (fs.existsSync("viper.json")) {
console.log(lang("general.missingpath"));
}
+
+// auto-updates
+{
+ setInterval(async _ => {
+ const localVersion = getNSVersion();
+ const distantVersion = await requests.getLatestNsVersion();
+
+ if (localVersion !== distantVersion) {
+ console.log('Northstar update available');
+ update();
+ }
+ },
+
+ // update checking interval must be bigger than cache validity duration
+ 15 * 60 * 1000);
+}
+
+
function setpath(win) {
if (! win) {
settings.gamepath = cli.param("setpath");