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.

21 lines
718 B

  1. const fs = require('fs-extra')
  2. const path = require('path')
  3. /* global WIKI */
  4. module.exports = {
  5. ext: {},
  6. async init () {
  7. const extDirs = await fs.readdir(path.join(WIKI.SERVERPATH, 'modules/extensions'))
  8. WIKI.logger.info(`Checking for installed optional extensions...`)
  9. for (let dir of extDirs) {
  10. WIKI.extensions.ext[dir] = require(path.join(WIKI.SERVERPATH, 'modules/extensions', dir, 'ext.js'))
  11. const isInstalled = await WIKI.extensions.ext[dir].check()
  12. if (isInstalled) {
  13. WIKI.logger.info(`Optional extension ${dir} is installed. [ OK ]`)
  14. } else {
  15. WIKI.logger.info(`Optional extension ${dir} was not found on this system. [ SKIPPED ]`)
  16. }
  17. }
  18. }
  19. }