Fixed plugin loading.

This commit is contained in:
SamTV12345 2024-03-13 21:16:23 +01:00
parent cba78089d0
commit 0ce10f0e39

View file

@ -26,6 +26,7 @@ const hooks = require('../../static/js/pluginfw/hooks.js');
const path = require('path');
const resolve = require('resolve');
const settings = require('../utils/Settings');
import {pluginInstallPath} from '../../static/js/pluginfw/installer'
const templateCache = new Map();
@ -82,7 +83,13 @@ exports.require = (name:string, args:{
basedir = path.dirname(mod.filename);
paths = mod.paths;
}
paths.push(settings.root + '/plugin_packages')
/**
* Add the plugin install path to the paths array
*/
if (!paths.includes(pluginInstallPath)) {
paths.push(pluginInstallPath)
}
const ejspath = resolve.sync(name, {paths, basedir, extensions: ['.html', '.ejs']});