aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-02-21 21:39:26 +0100
committerGitHub <noreply@github.com>2022-02-21 21:39:26 +0100
commit68d933367c90ee2d3ef140cc4c30d5529b3872f8 (patch)
tree58ea43e3e285a457a20bb0d4d403282c97421c0a
parent002d14d8094e950caa72d612e8ddac881c1ea7ff (diff)
parentabbbc57db31e888ab8200a7296b0083774af9700 (diff)
downloadViper-68d933367c90ee2d3ef140cc4c30d5529b3872f8.tar.gz
Viper-68d933367c90ee2d3ef140cc4c30d5529b3872f8.zip
Merge pull request #87 from Alystrasz/fix/updates-order
[fix] updates checking order
-rw-r--r--src/utils.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js
index 2ea91cd..336017f 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -73,9 +73,9 @@ async function isGameRunning() {
//
// It uses isGameRunning() to ensure it doesn't run while the game is
// running, as that may have all kinds of issues.
-northstar_auto_updates: {
+function handleNorthstarAutoUpdating() {
if (!settings.autoupdate || !fs.existsSync("viper.json") || settings.gamepath.length === 0) {
- break northstar_auto_updates;
+ return;
}
async function _checkForUpdates() {
@@ -306,7 +306,11 @@ function updatevp(autoinstall) {
}
autoUpdater.on("error", (info) => {cli.exit(1)});
- autoUpdater.on("update-not-available", (info) => {cli.exit()});
+ autoUpdater.on("update-not-available", (info) => {
+ // only check for N* updates if Viper itself has no updates
+ handleNorthstarAutoUpdating();
+ cli.exit();
+ });
autoUpdater.checkForUpdatesAndNotify();
}