mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-19 17:38:19 +08:00
core: loader.reloadPlugin: remove first arg
This commit is contained in:
5 files changed
+13
-8
No files matched your search
@@ -123,10 +123,15 @@ export async function load(ctx: Context) {
|
||||
await model(pending, fail, ctx);
|
||||
await setting(pending, fail, require('../model/setting'));
|
||||
ctx.plugin(require('../service/server'));
|
||||
ctx = await new Promise((resolve) => {
|
||||
ctx.inject(['server'], (c) => {
|
||||
resolve(c);
|
||||
});
|
||||
});
|
||||
await addon(pending, fail, ctx);
|
||||
const scriptDir = path.resolve(__dirname, '..', 'script');
|
||||
for (const h of await fs.readdir(scriptDir)) {
|
||||
ctx.loader.reloadPlugin(ctx, path.resolve(scriptDir, h), {}, `hydrooj/script/${h.split('.')[0]}`);
|
||||
ctx.loader.reloadPlugin(path.resolve(scriptDir, h), {}, `hydrooj/script/${h.split('.')[0]}`);
|
||||
}
|
||||
await script(pending, fail, ctx);
|
||||
await cli();
|
||||
|
||||
Reference in new issue
Block a user