judge: add yargs to dep

This commit is contained in:
undefined committed 2020-10-27 13:46:00 +08:00
1 parent cf6e314071
commit aad53cf51e
2 files changed
+7 -4

No files matched your search

+3 -1
View File
@@ -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;