mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
judge: fix user_extra_files
This commit is contained in:
1 parent
a673523b9a
commit
de96722d57
4 files changed
+13
-5
No files matched your search
@@ -1,7 +1,7 @@
|
||||
{
|
||||
"name": "@hydrooj/hydrojudge",
|
||||
"bin": "bin/hydrojudge.js",
|
||||
"version": "2.8.2",
|
||||
"version": "2.8.3",
|
||||
"main": "package.json",
|
||||
"author": "undefined <i@undefined.moe>",
|
||||
"repository": "https://github.com/hydro-dev/Hydro.git",
|
||||
|
||||
@@ -135,7 +135,9 @@ export const judge = async (ctx) => {
|
||||
for (const file of ctx.config.user_extra_files) {
|
||||
copyIn[parseFilename(file)] = { src: file };
|
||||
}
|
||||
return await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
const execute = await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
execute.copyIn = { ...copyIn, ...execute.copyIn };
|
||||
return execute;
|
||||
})(),
|
||||
(async () => {
|
||||
if (!ctx.config.checker_type || ctx.config.checker_type === 'default') {
|
||||
|
||||
@@ -25,7 +25,9 @@ export const judge = async (ctx) => {
|
||||
for (const file of ctx.config.user_extra_files) {
|
||||
copyIn[parseFilename(file)] = { src: file };
|
||||
}
|
||||
return await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
const exec = await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
exec.copyIn = { ...copyIn, ...exec.copyIn };
|
||||
return exec;
|
||||
})(),
|
||||
// Validator
|
||||
(async () => {
|
||||
@@ -43,7 +45,9 @@ export const judge = async (ctx) => {
|
||||
copyIn[parseFilename(file)] = { src: file };
|
||||
}
|
||||
const file = await fs.readFile(ctx.config.std);
|
||||
return await compile(ctx.getLang(parseFilename(ctx.config.std).split('.')[1]), file.toString(), 'std', copyIn);
|
||||
const exec = await compile(ctx.getLang(parseFilename(ctx.config.std).split('.')[1]), file.toString(), 'std', copyIn);
|
||||
exec.copyIn = { ...copyIn, ...exec.copyIn };
|
||||
return exec;
|
||||
})(),
|
||||
// Checker
|
||||
(async () => {
|
||||
|
||||
@@ -97,7 +97,9 @@ export const judge = async (ctx) => {
|
||||
for (const file of ctx.config.user_extra_files) {
|
||||
copyIn[parseFilename(file)] = { src: file };
|
||||
}
|
||||
return await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
const execute = await compile(ctx.getLang(ctx.lang), ctx.code, 'code', copyIn, ctx.next);
|
||||
execute.copyIn = { ...copyIn, ...execute.copyIn };
|
||||
return execute;
|
||||
})(),
|
||||
(async () => {
|
||||
const copyIn = { 'testlib.h': { src: testlibSrc } };
|
||||
|
||||
Reference in new issue
Block a user