From 7298eac8ae23f406a2724ccd1a477c2bc7696f3d Mon Sep 17 00:00:00 2001 From: 0neGal Date: Mon, 31 Jul 2023 14:59:14 +0200 Subject: remove "error:" from console errors Now they simply have the red color instead. --- src/cli.js | 4 ++-- src/index.js | 8 +++++++- src/modules/launch.js | 2 +- src/modules/mods.js | 14 +++++++------- 4 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/cli.js b/src/cli.js index 34dd8dc..9ba5fd7 100644 --- a/src/cli.js +++ b/src/cli.js @@ -43,7 +43,7 @@ function gamepathExists() { gamepath = json("viper.json").gamepath; if (! fs.existsSync(gamepath)) { - console.error(`error: ${lang("cli.gamepath.lost")}`); + console.error(lang("cli.gamepath.lost")); exit(1); } else { return true; @@ -88,7 +88,7 @@ async function init() { if (cli.getSwitchValue("setpath") != "") { ipcMain.emit("setpathcli", cli.getSwitchValue("setpath")); } else { - console.error(`error: ${lang("cli.setpath.noarg")}`); + console.error(lang("cli.setpath.noarg")); exit(1); } } diff --git a/src/index.js b/src/index.js index 3e7e08f..ed0fb3a 100644 --- a/src/index.js +++ b/src/index.js @@ -134,8 +134,14 @@ function start() { // allows renderer to check for updates ipcMain.on("ns-update-event", (event) => {send("ns-update-event", event)}); + + let update_active; ipcMain.on("can-autoupdate", () => { - if (! autoUpdater.isUpdaterActive() || cli.hasParam("no-vp-updates")) { + if (typeof update_active == "undefined") { + update_active = autoUpdater.isUpdaterActive(); + } + + if (! update_active || cli.hasParam("no-vp-updates")) { send("cant-autoupdate"); } }) diff --git a/src/modules/launch.js b/src/modules/launch.js index af9939b..8801d1b 100644 --- a/src/modules/launch.js +++ b/src/modules/launch.js @@ -16,7 +16,7 @@ function launch(game_version) { // return early, and show error message if on Linux if (process.platform == "linux") { win.alert(lang("cli.launch.linuxerror")); - console.error("error:", lang("cli.launch.linuxerror")); + console.error(lang("cli.launch.linuxerror")); cli.exit(1); return; } diff --git a/src/modules/mods.js b/src/modules/mods.js index 3c469c3..78b1ab9 100644 --- a/src/modules/mods.js +++ b/src/modules/mods.js @@ -35,7 +35,7 @@ mods.list = () => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.error("error: " + lang("general.notinstalled")); + console.error(lang("general.notinstalled")); cli.exit(1); return false; } @@ -180,7 +180,7 @@ mods.get = (mod) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.error("error: " + lang("general.notinstalled")); + console.error(lang("general.notinstalled")); cli.exit(1); return false; } @@ -314,14 +314,14 @@ mods.install = (mod, opts) => { if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.error("error: " + lang("general.notinstalled")); + console.error(lang("general.notinstalled")); cli.exit(1); return false; } let notamod = () => { win.log(lang("gui.mods.notamod")); - console.error("error: " + lang("cli.mods.notamod")); + console.error(lang("cli.mods.notamod")); cli.exit(1); return false; } @@ -561,7 +561,7 @@ mods.remove = (mod) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.error("error: " + lang("general.notinstalled")); + console.error(lang("general.notinstalled")); cli.exit(1); return false; } @@ -579,7 +579,7 @@ mods.remove = (mod) => { let mod_name = mod_data.folder_name; if (! mod_name) { - console.error("error: " + lang("cli.mods.cantfind")); + console.error(lang("cli.mods.cantfind")); cli.exit(1); return; } @@ -633,7 +633,7 @@ mods.toggle = (mod, fork) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.error("error: " + lang("general.notinstalled")); + console.error(lang("general.notinstalled")); cli.exit(1); return false; } -- cgit v1.2.3