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

+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({