mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +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",
|
"name": "@hydrooj/hydrojudge",
|
||||||
"bin": "bin/hydrojudge.js",
|
"bin": "bin/hydrojudge.js",
|
||||||
"version": "2.6.1",
|
"version": "2.6.2",
|
||||||
"main": "package.json",
|
"main": "package.json",
|
||||||
"author": "undefined <i@undefined.moe>",
|
"author": "undefined <i@undefined.moe>",
|
||||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||||
|
|||||||
@@ -178,7 +178,7 @@ async function readAutoCases(folder, { next }, cfg, rst) {
|
|||||||
Object.assign(config, result);
|
Object.assign(config, result);
|
||||||
next({ message: { message: 'Found {0} testcases.', params: [config.count] } });
|
next({ message: { message: 'Found {0} testcases.', params: [config.count] } });
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
throw new SystemError('Cannot parse testdata.', [e]);
|
throw new SystemError('Cannot parse testdata.', [e.message, ...e.params]);
|
||||||
}
|
}
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@@ -220,7 +220,7 @@ export default async function readCases(folder: string, cfg: Record<string, any>
|
|||||||
}
|
}
|
||||||
let auto = !result.outputs?.length;
|
let auto = !result.outputs?.length;
|
||||||
if (auto) {
|
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;
|
auto = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -72,6 +72,7 @@ export function restrictFile(p: string) {
|
|||||||
|
|
||||||
export function ensureFile(folder: string) {
|
export function ensureFile(folder: string) {
|
||||||
return (file: string, message: string) => {
|
return (file: string, message: string) => {
|
||||||
|
if (file === '/dev/null') return file;
|
||||||
// Historical issue
|
// Historical issue
|
||||||
if (file.includes('/')) {
|
if (file.includes('/')) {
|
||||||
const f = path.join(folder, restrictFile(file.split('/')[1]));
|
const f = path.join(folder, restrictFile(file.split('/')[1]));
|
||||||
|
|||||||
Reference in new issue
Block a user