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`);