diff options
author | 0neGal <mail@0negal.com> | 2022-01-15 03:02:20 +0100 |
---|---|---|
committer | 0neGal <mail@0negal.com> | 2022-01-15 03:02:20 +0100 |
commit | 4530f682a674ac53f813f2c4194430cbe299f86d (patch) | |
tree | 3a54cb470d06923a65cdbaaa76fec002b6fa0c9a | |
parent | 17d20e4b462971f484a6e51ad5ba55e84b96363f (diff) | |
download | Viper-4530f682a674ac53f813f2c4194430cbe299f86d.tar.gz Viper-4530f682a674ac53f813f2c4194430cbe299f86d.zip |
fix error when R2Northstar/mods isn't created
-rw-r--r-- | src/utils.js | 9 |
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()) { |