electron launcher
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.

18 lines
532 B

4 years ago
  1. const fse = require('fs-extra')
  2. const path = require('path')
  3. const { app } = require('electron')
  4. module.exports = async (event, arg) => {
  5. const appsDir = path.resolve(app.getPath('home'), `./s207/apps`)
  6. let apps = await fse.readdirSync(appsDir)
  7. apps = await Promise.all(apps.map((id) => {
  8. const appDir = path.resolve(appsDir, `./${id}`)
  9. const appJson = fse.readJsonSync(path.resolve(appDir, `./app.json`))
  10. return {
  11. ...appJson,
  12. appDir
  13. }
  14. }))
  15. return apps
  16. }