diff options
author | 0neGal <mail@0negal.com> | 2023-07-22 16:09:41 +0200 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2023-07-22 16:09:41 +0200 |
commit | 11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02 (patch) | |
tree | 29fbc46781019ccc19c53664a27042acd4112f25 /src/modules/mods.js | |
parent | e984cf81b7fd84c44fb39206c639c35a44c6054c (diff) | |
download | Viper-11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02.tar.gz Viper-11f2bc2de10e5ec7bb8a8b102855e9b7f0122c02.zip |
colored console logging
Far prettier, and far more useful at a glance.
Diffstat (limited to 'src/modules/mods.js')
-rw-r--r-- | src/modules/mods.js | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/modules/mods.js b/src/modules/mods.js index 095e501..fc2a682 100644 --- a/src/modules/mods.js +++ b/src/modules/mods.js @@ -10,6 +10,8 @@ const win = require("./window"); const version = require("./version"); const settings = require("./settings"); +console = require("./console"); + const cli = require("../cli"); const lang = require("../lang"); @@ -33,7 +35,7 @@ mods.list = () => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.log("error: " + lang("general.notinstalled")); + console.error("error: " + lang("general.notinstalled")); cli.exit(1); return false; } @@ -124,7 +126,7 @@ mods.get = (mod) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.log("error: " + lang("general.notinstalled")); + console.error("error: " + lang("general.notinstalled")); cli.exit(1); return false; } @@ -258,20 +260,20 @@ mods.install = (mod, opts) => { if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.log("error: " + lang("general.notinstalled")); + console.error("error: " + lang("general.notinstalled")); cli.exit(1); return false; } let notamod = () => { win.log(lang("gui.mods.notamod")); - console.log("error: " + lang("cli.mods.notamod")); + console.error("error: " + lang("cli.mods.notamod")); cli.exit(1); return false; } let installed = () => { - console.log(lang("cli.mods.installed")); + console.ok(lang("cli.mods.installed")); cli.exit(); win.log(lang("gui.mods.installedmod")); @@ -505,7 +507,7 @@ mods.remove = (mod) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.log("error: " + lang("general.notinstalled")); + console.error("error: " + lang("general.notinstalled")); cli.exit(1); return false; } @@ -521,7 +523,7 @@ mods.remove = (mod) => { let mod_name = mods.get(mod).FolderName; if (! mod_name) { - console.log("error: " + lang("cli.mods.cantfind")); + console.error("error: " + lang("cli.mods.cantfind")); cli.exit(1); return; } @@ -544,7 +546,7 @@ mods.remove = (mod) => { // actually remove the mod itself fs.rmSync(path_to_mod, {recursive: true}); - console.log(lang("cli.mods.removed")); + console.ok(lang("cli.mods.removed")); cli.exit(); ipcMain.emit("gui-getmods"); // send updated list to renderer @@ -569,7 +571,7 @@ mods.toggle = (mod, fork) => { // make sure Northstar is actually installed if (version.northstar() == "unknown") { win.log(lang("general.notinstalled")); - console.log("error: " + lang("general.notinstalled")); + console.error("error: " + lang("general.notinstalled")); cli.exit(1); return false; } @@ -581,7 +583,7 @@ mods.toggle = (mod, fork) => { mods.toggle(modlist[i].Name, true); // enable mod } - console.log(lang("cli.mods.toggledall")); + console.ok(lang("cli.mods.toggledall")); cli.exit(0); return } @@ -590,7 +592,7 @@ mods.toggle = (mod, fork) => { mods.modfile.toggle(mod); if (! fork) { - console.log(lang("cli.mods.toggled")); + console.ok(lang("cli.mods.toggled")); cli.exit(); } |