diff --git a/packages/hydrooj/src/entry/cli.ts b/packages/hydrooj/src/entry/cli.ts index 10a9fdc1..67a169ae 100644 --- a/packages/hydrooj/src/entry/cli.ts +++ b/packages/hydrooj/src/entry/cli.ts @@ -4,6 +4,7 @@ import path from 'path'; import cac from 'cac'; import fs from 'fs-extra'; import { ObjectID } from 'mongodb'; +import { Context } from '../context'; import db from '../service/db'; import { addon, lib, model, script, service, setting, @@ -79,7 +80,7 @@ async function cli() { return console.log(result); } -export async function load(ctx) { +export async function load(ctx: Context) { const pending = global.addons; const fail = []; require('../lib/i18n'); @@ -100,6 +101,7 @@ export async function load(ctx) { model(pending, fail, ctx), setting(pending, fail, require('../model/setting')), ]); + await require('hydrooj/src/service/server').apply(ctx); await addon(pending, fail, ctx); const scriptDir = path.resolve(__dirname, '..', 'script'); for (const h of await fs.readdir(scriptDir)) { diff --git a/packages/utils/package.json b/packages/utils/package.json index f2629021..d8060979 100644 --- a/packages/utils/package.json +++ b/packages/utils/package.json @@ -2,7 +2,7 @@ "name": "@hydrooj/utils", "version": "1.4.0", "description": "hydrooj utils", - "main": "package.json", + "main": "lib/utils.ts", "repository": "https://github.com/hydro-dev/Hydro.git", "author": "undefined ", "license": "AGPL-3.0-or-later",