You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
19 lines
532 B
19 lines
532 B
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
|
|
}
|