mirror of
https://github.com/Equicord/Equicord.git
synced 2025-06-13 00:23:02 -04:00
fix: plugin dependencies not enabling (#150)
This commit is contained in:
parent
ff9d904fcb
commit
ffbb52512c
3 changed files with 114 additions and 18 deletions
|
@ -42,6 +42,26 @@ export function startAllPlugins() {
|
|||
}
|
||||
}
|
||||
|
||||
export function startDependenciesRecursive(p: Plugin) {
|
||||
let restartNeeded = false;
|
||||
const failures: string[] = [];
|
||||
if (p.dependencies) for (const dep of p.dependencies) {
|
||||
if (!Settings.plugins[dep].enabled) {
|
||||
startDependenciesRecursive(Plugins[dep]);
|
||||
// If the plugin has patches, don't start the plugin, just enable it.
|
||||
if (Plugins[dep].patches) {
|
||||
logger.warn(`Enabling dependency ${dep} requires restart.`);
|
||||
Settings.plugins[dep].enabled = true;
|
||||
restartNeeded = true;
|
||||
continue;
|
||||
}
|
||||
const result = startPlugin(Plugins[dep]);
|
||||
if (!result) failures.push(dep);
|
||||
}
|
||||
}
|
||||
return { restartNeeded, failures };
|
||||
}
|
||||
|
||||
export function startPlugin(p: Plugin) {
|
||||
if (p.start) {
|
||||
logger.info("Starting plugin", p.name);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue