judge: provide HYDRO_LANG in compile stage

This commit is contained in:
undefined committed 2022-03-11 13:25:06 +08:00
1 parent 2bad82ab81
commit f1734761c3
2 files changed
+6 -2

No files matched your search

+1 -1
View File
@@ -1,7 +1,7 @@
{
"name": "@hydrooj/hydrojudge",
"bin": "bin/hydrojudge.js",
"version": "2.14.3",
"version": "2.14.4",
"main": "package.json",
"author": "undefined <i@undefined.moe>",
"repository": "https://github.com/hydro-dev/Hydro.git",
+5 -1
View File
@@ -17,7 +17,11 @@ export = async function compile(
status, stdout, stderr, fileIds,
} = await run(
copyIn['compile.sh'] ? '/bin/bash compile.sh' : lang.compile,
{ copyIn: { ...copyIn, [lang.code_file]: { content: code } }, copyOutCached: [target] },
{
copyIn: { ...copyIn, [lang.code_file]: { content: code } },
copyOutCached: [target],
env: { HYDRO_LANG: lang.key },
},
);
if (status !== STATUS.STATUS_ACCEPTED) throw new CompileError({ status, stdout, stderr });
if (!fileIds[target]) throw new CompileError({ stderr: 'Executable file not found.' });