mirror of https://github.com/requarks/wiki
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.
20 lines
713 B
20 lines
713 B
2 years ago
|
import fs from 'node:fs/promises'
|
||
|
import path from 'path'
|
||
5 years ago
|
|
||
2 years ago
|
export default {
|
||
5 years ago
|
ext: {},
|
||
|
async init () {
|
||
|
const extDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/extensions'))
|
||
|
WIKI.logger.info(`Checking for installed optional extensions...`)
|
||
2 years ago
|
for (const dir of extDirs) {
|
||
|
WIKI.extensions.ext[dir] = (await import(path.join(WIKI.SERVERPATH, 'modules/extensions', dir, 'ext.mjs'))).default
|
||
5 years ago
|
const isInstalled = await WIKI.extensions.ext[dir].check()
|
||
|
if (isInstalled) {
|
||
|
WIKI.logger.info(`Optional extension ${dir} is installed. [ OK ]`)
|
||
|
} else {
|
||
|
WIKI.logger.info(`Optional extension ${dir} was not found on this system. [ SKIPPED ]`)
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|