diff options
author | Alystrasz <contact@remyraes.com> | 2022-01-08 18:59:50 +0100 |
---|---|---|
committer | Alystrasz <contact@remyraes.com> | 2022-01-08 18:59:50 +0100 |
commit | e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b (patch) | |
tree | a8a6692d538ea0ad1a4d7962140b63d2a62952ce | |
parent | 61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4 (diff) | |
download | Viper-e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b.tar.gz Viper-e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b.zip |
[feat] checking every 15 minutes for new Northstar version
-rw-r--r-- | src/utils.js | 18 |
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"); |