mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 17:36:08 +08:00
judge: fix
This commit is contained in:
1 parent
05ea014b79
commit
6b5f91d155
3 files changed
+4
-3
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.6.1",
|
||||
"version": "2.6.2",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -178,7 +178,7 @@ async function readAutoCases(folder, { next }, cfg, rst) {
|
||||
Object.assign(config, result);
|
||||
next({ message: { message: 'Found {0} testcases.', params: [config.count] } });
|
||||
} catch (e) {
|
||||
throw new SystemError('Cannot parse testdata.', [e]);
|
||||
throw new SystemError('Cannot parse testdata.', [e.message, ...e.params]);
|
||||
}
|
||||
return config;
|
||||
}
|
||||
@@ -220,7 +220,7 @@ export default async function readCases(folder: string, cfg: Record<string, any>
|
||||
}
|
||||
let auto = !result.outputs?.length;
|
||||
if (auto) {
|
||||
if (result.subtasks.length && !Math.sum(result.subtasks.map((subtask) => subtask.cases.length))) {
|
||||
if (result.subtasks.length && Math.sum(result.subtasks.map((subtask) => subtask.cases.length))) {
|
||||
auto = false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -72,6 +72,7 @@ export function restrictFile(p: string) {
|
||||
|
||||
export function ensureFile(folder: string) {
|
||||
return (file: string, message: string) => {
|
||||
if (file === '/dev/null') return file;
|
||||
// Historical issue
|
||||
if (file.includes('/')) {
|
||||
const f = path.join(folder, restrictFile(file.split('/')[1]));
|
||||
|
||||
Reference in new issue
Block a user