aboutsummaryrefslogtreecommitdiff
path: root/src/index.js
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-08 15:05:35 +0100
committer0neGal <mail@0negal.com>2022-01-08 15:13:07 +0100
commit1c12fb2e90d26e25be6206076ad6762fa92a5962 (patch)
tree89e0035a458948f58ccc9b4aa4cac7fccb523cd5 /src/index.js
parent927def020baf544a23140ba8cfa53dcef9f23aa8 (diff)
downloadViper-1c12fb2e90d26e25be6206076ad6762fa92a5962.tar.gz
Viper-1c12fb2e90d26e25be6206076ad6762fa92a5962.zip
added cli arguments for mods
This adds both the arguments themselves, but also their entries in the man page and help page.
Diffstat (limited to 'src/index.js')
-rw-r--r--src/index.js16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/index.js b/src/index.js
index c03326c..09aa626 100644
--- a/src/index.js
+++ b/src/index.js
@@ -54,15 +54,20 @@ function start() {
ipcMain.on("updatenow", () => {
autoUpdater.quitAndInstall();
})
+}
- ipcMain.on("removemod", (event, mod) => {utils.mods.remove(mod)})
- ipcMain.on("togglemod", (event, mod) => {utils.mods.toggle(mod)})
- ipcMain.on("installmod", () => {
+ipcMain.on("installmod", () => {
+ if (cli.hasArgs()) {
+ utils.mods.install(cli.param("installmod"))
+ } else {
dialog.showOpenDialog({properties: ["openFile"]}).then(res => {
utils.mods.install(res.filePaths[0]);
}).catch(err => {console.error(err)})
- })
-}
+ }
+})
+
+ipcMain.on("removemod", (event, mod) => {utils.mods.remove(mod)})
+ipcMain.on("togglemod", (event, mod) => {utils.mods.toggle(mod)})
ipcMain.on("launch", (event) => {utils.launch()})
ipcMain.on("setlang", (event, lang) => {utils.setlang(lang)})
@@ -77,6 +82,7 @@ ipcMain.on("setpath", (event, value) => {
win.show();
}
});
+
ipcMain.on("newpath", (event, newpath) => {
if (newpath === false && !win.isVisible()) {
win.webContents.send("nopathselected");