aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-02-23 18:18:38 +0100
committer0neGal <mail@0negal.com>2022-02-23 18:18:38 +0100
commit70309583c81622ff5f5d41e2a9b85df287792326 (patch)
tree1c798b113b19f1c5ffe68dec5b577ac79dae3cac /src/utils.js
parent815106a3e1214196b25a380d83e826473840f948 (diff)
parente96135cbc3877423f4c6c012c5d7e09436e5b32c (diff)
downloadViper-70309583c81622ff5f5d41e2a9b85df287792326.tar.gz
Viper-70309583c81622ff5f5d41e2a9b85df287792326.zip
Merge 0neGal/viper into settings-page
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/utils.js b/src/utils.js
index 5055a2e..2449a73 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -75,9 +75,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() {
@@ -313,7 +313,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();
}