diff options
author | 0neGal <mail@0negal.com> | 2022-01-08 16:49:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-08 16:49:57 +0100 |
commit | 61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4 (patch) | |
tree | ba786f87cdefd22cd54413517fcfb2359f7f3bae /src/cli.js | |
parent | 5206e9e4051b5c90e11b3aa331b0f6ee5546d25e (diff) | |
parent | 8ad3b0522aee4afc0d7494aaf3927c388752b24c (diff) | |
download | Viper-61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4.tar.gz Viper-61384d15d1fb34511cdb78690b5ec4e2f7d7a7c4.zip |
Merge pull request #19 from 0neGal/mod-support
Adds mod support, removing, installing and toggling mods, both CLI and GUI
Diffstat (limited to 'src/cli.js')
-rw-r--r-- | src/cli.js | 30 |
1 files changed, 22 insertions, 8 deletions
@@ -10,12 +10,16 @@ const lang = require("./lang"); function hasArgs() { if (cli.hasSwitch("cli") || cli.hasSwitch("help") || + cli.hasSwitch("mods") || cli.hasSwitch("update") || cli.hasSwitch("launch") || cli.hasSwitch("setpath") || cli.hasSwitch("version") || cli.hasSwitch("updatevp") || - cli.hasSwitch("gamepath")) { + cli.hasSwitch("gamepath") || + cli.hasSwitch("togglemod") || + cli.hasSwitch("removemod") || + cli.hasSwitch("installmod")) { return true; } else {return false} } @@ -27,14 +31,18 @@ function exit(code) { async function init() { if (cli.hasSwitch("help")) { console.log(`options: - --help ${lang("cli.help.help")} - --debug ${lang("cli.help.debug")} - --version ${lang("cli.help.version")} + --help ${lang("cli.help.help")} + --debug ${lang("cli.help.debug")} + --version ${lang("cli.help.version")} - --cli ${lang("cli.help.cli")} - --update ${lang("cli.help.update")} - --updatevp ${lang("cli.help.updatevp")} - --setpath ${lang("cli.help.setpath")}`) + --cli ${lang("cli.help.cli")} + --update ${lang("cli.help.update")} + --updatevp ${lang("cli.help.updatevp")} + --setpath ${lang("cli.help.setpath")} + + --installmod ${lang("cli.help.installmod")} + --removemod ${lang("cli.help.removemod")} + --togglemod ${lang("cli.help.togglemod")}`) // In the future --setpath should be able to understand // relative paths, instead of just absolute ones. exit(); @@ -62,6 +70,12 @@ async function init() { break; } } + + if (cli.hasSwitch("installmod")) {ipcMain.emit("installmod")} + if (cli.hasSwitch("removemod")) {ipcMain.emit("removemod", "", cli.getSwitchValue("removemod"))} + if (cli.hasSwitch("togglemod")) {ipcMain.emit("togglemod", "", cli.getSwitchValue("togglemod"))} + + if (cli.hasSwitch("mods")) {ipcMain.emit("getmods")} } module.exports = { |