diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/cli.js | 4 | ||||
-rw-r--r-- | src/index.js | 8 | ||||
-rw-r--r-- | src/modules/launch.js | 2 | ||||
-rw-r--r-- | src/modules/mods.js | 14 |
4 files changed, 17 insertions, 11 deletions
@@ -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; } |