aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-07-31 14:59:14 +0200
committer0neGal <mail@0negal.com>2023-07-31 14:59:14 +0200
commit7298eac8ae23f406a2724ccd1a477c2bc7696f3d (patch)
tree20389cec537b1770f5ed3510e0fa175ef89ec599
parentc1040516db8ec60b6922c989399f0fc43d8ab18a (diff)
downloadViper-7298eac8ae23f406a2724ccd1a477c2bc7696f3d.tar.gz
Viper-7298eac8ae23f406a2724ccd1a477c2bc7696f3d.zip
remove "error:" from console errors
Now they simply have the red color instead.
-rw-r--r--src/cli.js4
-rw-r--r--src/index.js8
-rw-r--r--src/modules/launch.js2
-rw-r--r--src/modules/mods.js14
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;
}