mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 17:46:28 +08:00
core: mark model as plugin
This commit is contained in:
1 parent
7f96f602ce
commit
90a9fa95f4
21 files changed
+117
-89
No files matched your search
@@ -56,6 +56,14 @@ export const lib = getLoader('lib', 'lib');
|
||||
export const script = getLoader('script', 'script');
|
||||
export const service = getLoader('service', 'service');
|
||||
|
||||
export async function builtinModel(ctx: Context) {
|
||||
const modelDir = path.resolve(__dirname, '..', 'model');
|
||||
const models = ['task', 'blacklist', 'discussion', 'document'];
|
||||
for (const t of models) {
|
||||
ctx.loader.reloadPlugin(ctx, path.resolve(modelDir, t), {}, `hydrooj/model/${t}`);
|
||||
}
|
||||
}
|
||||
|
||||
export async function locale(pending: string[], fail: string[]) {
|
||||
await Promise.all(pending.map(async (i) => {
|
||||
const p = locateFile(i, ['locale', 'locales']);
|
||||
|
||||
Reference in new issue
Block a user