judge: enable copyIn in execute stage

This commit is contained in:
undefined committed 2022-03-06 20:44:51 +08:00
1 parent 616af2655e
commit a9082354c8
2 files changed
+11 -5

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.14.1",
"version": "2.14.2",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
@@ -10,7 +10,7 @@
"axios": "^0.25.0",
"cac": "^6.7.12",
"esbuild": "0.14.3",
"fs-extra": "^10.0.0",
"fs-extra": "^10.0.1",
"js-yaml": "^4.1.0",
"lodash": "^4.17.21",
"mongodb": "^3.7.3",
@@ -23,9 +23,9 @@
"devDependencies": {
"@types/fs-extra": "^9.0.13",
"@types/js-yaml": "^4.0.5",
"@types/lodash": "^4.14.178",
"@types/lodash": "^4.14.179",
"@types/shell-quote": "^1.7.1",
"@types/ws": "^8.2.2"
"@types/ws": "^8.5.2"
},
"peerDependencies": {
"hydrooj": "*"
+7 -1
View File
@@ -20,7 +20,13 @@ export const judge = async (ctx: Context) => {
ctx.stat.judge = new Date();
ctx.next({ status: STATUS.STATUS_COMPILING });
try {
ctx.execute = await compile(ctx.getLang(ctx.lang), ctx.code, {}, ctx.next);
ctx.execute = await compile(
ctx.getLang(ctx.lang), ctx.code,
Object.fromEntries(
(ctx.config.user_extra_files || []).map((i) => [i.split('/').pop(), { src: i }]),
),
ctx.next,
);
} catch (e) {
if (e instanceof CompileError) {
ctx.next({