mirror of
https://github.com/outline/outline.git
synced 2026-11-22 14:01:41 +03:00
21 lines
517 B
TypeScript
21 lines
517 B
TypeScript
import { Hook, PluginManager } from "@server/utils/PluginManager";
|
|
import { requireDirectory } from "@server/utils/fs";
|
|
import type { BaseTask } from "./base/BaseTask";
|
|
|
|
const tasks: Record<string, typeof BaseTask> = {};
|
|
|
|
requireDirectory<{ default: typeof BaseTask }>(__dirname).forEach(
|
|
([module, id]) => {
|
|
if (id === "index") {
|
|
return;
|
|
}
|
|
tasks[id] = module.default;
|
|
}
|
|
);
|
|
|
|
PluginManager.getHooks(Hook.Task).forEach((hook) => {
|
|
tasks[hook.value.name] = hook.value;
|
|
});
|
|
|
|
export default tasks;
|