const fse = require('fs-extra') const path = require('path') const { app } = require('electron') module.exports = async (event, arg) => { const appsDir = path.resolve(app.getPath('home'), `./s207/apps`) let apps = await fse.readdirSync(appsDir) apps = await Promise.all(apps.map((id) => { const appDir = path.resolve(appsDir, `./${id}`) const appJson = fse.readJsonSync(path.resolve(appDir, `./app.json`)) return { ...appJson, appDir } })) return apps }