Skip to content

Commit

Permalink
feat: support .asar addons
Browse files Browse the repository at this point in the history
  • Loading branch information
CyanSalt committed Jun 17, 2021
1 parent 19b6d60 commit 41dd5a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions api/modules/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,15 +75,16 @@ async function discoverAddons() {
// ignore
}
const directories = dirents
.filter(dirent => dirent.isDirectory())
.filter(dirent => dirent.isDirectory() || path.extname(dirent.name) === '.asar')
.map(dirent => dirent.name)
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
.filter(name => !discoveredAddons[name])
for (const name of directories) {
try {
const manifest = require(path.join(base, name, 'commas.json'))
const entry = path.join(base, name, 'index.js')
discoveredAddons[name] = { type, entry, manifest }
const basename = path.basename(name, '.asar')
discoveredAddons[basename] = { type, entry, manifest }
} catch {
// continue
}
Expand Down

0 comments on commit 41dd5a9

Please sign in to comment.