aboutsummaryrefslogtreecommitdiff
path: root/src/utils.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils.js')
-rw-r--r--src/utils.js11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/utils.js b/src/utils.js
index 1e05fed..67aee02 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -242,6 +242,7 @@ const mods = {
winLog(lang("gui.mods.notamod"))
console.log("error: " + lang("cli.mods.notamod"))
cli.exit(1);
+ return false;
}
let installed = () => {
@@ -250,8 +251,11 @@ const mods = {
winLog(lang("gui.mods.installedmod"))
ipcMain.emit("guigetmods");
+ return true;
}
+ if (! fs.existsSync(mod)) {return notamod()}
+
if (fs.statSync(mod).isDirectory()) {
winLog(lang("gui.mods.installing"))
if (fs.existsSync(path.join(mod, "mod.json")) &&
@@ -263,8 +267,7 @@ const mods = {
utimes: true,
});
- installed();
- return true;
+ return installed();
} else {
files = fs.readdirSync(mod);
@@ -296,9 +299,9 @@ const mods = {
.on("finish", () => {
if (mods.install(cache)) {
installed();
- } else {notamod();return false}
+ } else {return notamod()}
});
- }catch(err) {notamod();return false}
+ }catch(err) {return notamod()}
}
},
remove: (mod) => {