From 2e8f3e42cdd5bb08f37ea4dcb460343f2f2509a7 Mon Sep 17 00:00:00 2001 From: undefined Date: Sun, 8 Nov 2020 02:32:17 +0800 Subject: [PATCH] =?UTF-8?q?judge:=20=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8F=82=E6=95=B0=E4=BC=A0=E9=80=92=E5=BC=82?= =?UTF-8?q?=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/hydrojudge/package.json | 2 +- packages/hydrojudge/src/cases.ts | 3 +-- packages/hydrojudge/src/judge/default.ts | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/packages/hydrojudge/package.json b/packages/hydrojudge/package.json index 31d2666b5..cd1cd7d5a 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.19", + "version": "2.1.20", "main": "package.json", "author": "masnn", "repository": "https://github.com/hydro-dev/Hydro.git", diff --git a/packages/hydrojudge/src/cases.ts b/packages/hydrojudge/src/cases.ts index 6e92d3a8c..90bf29b85 100644 --- a/packages/hydrojudge/src/cases.ts +++ b/packages/hydrojudge/src/cases.ts @@ -204,7 +204,6 @@ export async function readYamlCases(folder: string, cfg: Dictionary = {}, a const next = args.next; const checkFile = ensureFile(folder); config.checker_type = cfg.checker_type || 'default'; - if (cfg.filename) config.filename = cfg.filename; if (cfg.checker) config.checker = checkFile(cfg.checker, '找不到比较器 '); if (cfg.judge_extra_files) { if (typeof cfg.judge_extra_files === 'string') { @@ -301,7 +300,7 @@ export default async function readCases(folder: string, cfg: Record config = { ...yaml.safeLoad(fs.readFileSync(yamlConfig).toString()) as object, ...cfg }; } else if (fs.existsSync(iniConfig)) { config = { ...convertIniConfig(fs.readFileSync(iniConfig).toString()), ...cfg }; - } + } else config = cfg; const result = await readYamlCases(folder, config, args); isValidConfig(result); return result; diff --git a/packages/hydrojudge/src/judge/default.ts b/packages/hydrojudge/src/judge/default.ts index 70b3f8cd0..f0ff7154a 100644 --- a/packages/hydrojudge/src/judge/default.ts +++ b/packages/hydrojudge/src/judge/default.ts @@ -20,7 +20,7 @@ function judgeCase(c) { return async (ctx, ctxSubtask) => { const { filename } = ctx.config; const { copyIn } = ctx.execute; - if (ctx.config.filename) copyIn[`${filename}.in`] = { src: c.input }; + if (filename) copyIn[`${filename}.in`] = { src: c.input }; const copyOut = filename ? [`${filename}.out`] : []; const stdin = filename ? null : c.input; const stdout = path.resolve(ctx.tmpdir, `${c.id}.out`);