From aad53cf51e4af2cb2608aa96a839a9415a871ad9 Mon Sep 17 00:00:00 2001 From: undefined Date: Tue, 27 Oct 2020 13:46:00 +0800 Subject: [PATCH] judge: add yargs to dep --- packages/hydrojudge/package.json | 7 ++++--- packages/hydrojudge/src/compile.ts | 4 +++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 6ac37361c..bcde8d7fd 100644 --- a/packages/hydrojudge/package.json +++ b/packages/hydrojudge/package.json @@ -1,7 +1,7 @@ { "name": "@hydrooj/hydrojudge", "bin": "bin/hydrojudge.js", - "version": "2.1.1", + "version": "2.1.2", "main": "package.json", "author": "masnn", "dependencies": { @@ -13,7 +13,8 @@ "p-queue": "^6.6.1", "shell-quote": "^1.7.2", "supports-color": "^7.2.0", - "systeminformation": "^4.27.11" + "systeminformation": "^4.27.11", + "yargs": "^16.1.0" }, "peerDependencies": { "hydrooj": "^2.13.3" @@ -29,4 +30,4 @@ "build": "tsc", "lint": "eslint . --ext ts --fix" } -} +} \ No newline at end of file diff --git a/packages/hydrojudge/src/compile.ts b/packages/hydrojudge/src/compile.ts index 70a16adba..5b8902455 100644 --- a/packages/hydrojudge/src/compile.ts +++ b/packages/hydrojudge/src/compile.ts @@ -7,7 +7,9 @@ import { compilerText } from './utils'; export = async function compile( lang: string, code: string, target: string, copyIn: any, next?: Function, ) { - const LANGS = yaml.safeLoad(await global.Hydro.model.system.get('hydrojudge.langs')); + const LANGS = global.Hydro + ? yaml.safeLoad(await global.Hydro.model.system.get('hydrojudge.langs')) + : require('./config').LANGS; if (!LANGS[lang]) throw new SystemError(`不支持的语言:${lang}`); const info = LANGS[lang]; target = info.target || target;