diff options
Diffstat (limited to 'src/utils.js')
-rw-r--r-- | src/utils.js | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/utils.js b/src/utils.js index 9e6154a..c89a033 100644 --- a/src/utils.js +++ b/src/utils.js @@ -164,7 +164,27 @@ function winLog(msg) { ipcMain.emit("winLog", msg, msg); } +const mods = { + list: () => { + let mods = []; + let modpath = path.join(settings.gamepath, "R2Northstar/mods"); + + files = fs.readdirSync(modpath) + files.forEach((file) => { + if (fs.statSync(path.join(modpath, file)).isDirectory()) { + if (fs.existsSync(path.join(modpath, file, "mod.json"))) { + mods.push(require(path.join(modpath, file, "mod.json"))) + } + } + }) + + return mods; + }, +} + module.exports = { + mods, + lang, winLog, launch, update, |