From e8fcdcd303fd0443c0677d9f1347c8fd3a8aee1b Mon Sep 17 00:00:00 2001 From: Alystrasz Date: Sat, 8 Jan 2022 18:59:50 +0100 Subject: [feat] checking every 15 minutes for new Northstar version --- src/utils.js | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'src') 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"); -- cgit v1.2.3