aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2023-03-05 22:05:49 +0100
committer0neGal <mail@0negal.com>2023-03-05 22:06:00 +0100
commitcf61a55b1e490befa976d4240593b535777caf69 (patch)
tree918ae99eb081785303c486c12c4590a40a7548a0
parenta5dd677c6e5e6c2cb3eec7a2edc08d15dfe43c7a (diff)
downloadViper-cf61a55b1e490befa976d4240593b535777caf69.tar.gz
Viper-cf61a55b1e490befa976d4240593b535777caf69.zip
fully get rid of utils.js
I'd managed to forget to change some function calls to their new modularized versions, that's now fixed.
-rw-r--r--src/cli.js5
-rw-r--r--src/index.js10
2 files changed, 6 insertions, 9 deletions
diff --git a/src/cli.js b/src/cli.js
index 55e12a1..e332085 100644
--- a/src/cli.js
+++ b/src/cli.js
@@ -52,9 +52,8 @@ function gamepathExists() {
// General CLI initialization
//
-// A lot of the CLI is handled through events sent back to the main
-// process or utils.js to handle, this is because we re-use these events
-// for the renderer as well.
+// A lot of the CLI is handled through events sent back to the main process for
+// it to handle, this is because we re-use these events for the renderer as.
async function init() {
// --help menu/argument
if (cli.hasSwitch("help")) {
diff --git a/src/index.js b/src/index.js
index d94b6a4..64f69cd 100644
--- a/src/index.js
+++ b/src/index.js
@@ -66,7 +66,7 @@ function start() {
ipcMain.on("exit", () => {
if (settings.originkill) {
- utils.isOriginRunning().then((running) => {
+ is_running.origin().then((running) => {
if (running) {
kill.origin().then(process.exit(0))
} else {
@@ -146,8 +146,6 @@ function start() {
})
}
-// General events used to handle utils.js stuff without requiring the
-// module inside the file that sent the event. {
ipcMain.on("install-mod", () => {
if (cli.hasArgs()) {
mods.install(cli.param("installmod"));
@@ -221,14 +219,14 @@ ipcMain.on("version-cli", () => {
ipcMain.on("getmods", () => {
let mods = mods.list();
if (mods.all.length > 0) {
- log(`${utils.lang("general.mods.installed")} ${mods.all.length}`);
- log(`${utils.lang("general.mods.enabled")} ${mods.enabled.length}`);
+ log(`${lang("general.mods.installed")} ${mods.all.length}`);
+ log(`${lang("general.mods.enabled")} ${mods.enabled.length}`);
for (let i = 0; i < mods.enabled.length; i++) {
log(` ${mods.enabled[i].Name} ${mods.enabled[i].Version}`);
}
if (mods.disabled.length > 0) {
- log(`${utils.lang("general.mods.disabled")} ${mods.disabled.length}`);
+ log(`${lang("general.mods.disabled")} ${mods.disabled.length}`);
for (let i = 0; i < mods.disabled.length; i++) {
log(` ${mods.disabled[i].Name} ${mods.disabled[i].Version}`);
}