aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author0neGal <mail@0negal.com>2022-01-15 03:02:20 +0100
committer0neGal <mail@0negal.com>2022-01-15 03:02:20 +0100
commit4530f682a674ac53f813f2c4194430cbe299f86d (patch)
tree3a54cb470d06923a65cdbaaa76fec002b6fa0c9a
parent17d20e4b462971f484a6e51ad5ba55e84b96363f (diff)
downloadViper-4530f682a674ac53f813f2c4194430cbe299f86d.tar.gz
Viper-4530f682a674ac53f813f2c4194430cbe299f86d.zip
fix error when R2Northstar/mods isn't created
-rw-r--r--src/utils.js9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js
index 17091b4..4cdb5f5 100644
--- a/src/utils.js
+++ b/src/utils.js
@@ -271,6 +271,15 @@ const mods = {
let mods = [];
let disabled = [];
+ if (! fs.existsSync(modpath)) {
+ fs.mkdirSync(path.join(modpath + "disabled"), {recursive: true})
+ return {
+ enabled: [],
+ disabled: [],
+ all: []
+ };
+ }
+
files = fs.readdirSync(modpath)
files.forEach((file) => {
if (fs.statSync(path.join(modpath, file)).isDirectory()) {