mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 09:46:28 +08:00
judge: provide HYDRO_LANG in compile stage
This commit is contained in:
1 parent
2bad82ab81
commit
f1734761c3
2 files changed
+6
-2
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.14.3",
|
"version": "2.14.4",
|
||||||
"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",
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ export = async function compile(
|
|||||||
status, stdout, stderr, fileIds,
|
status, stdout, stderr, fileIds,
|
||||||
} = await run(
|
} = await run(
|
||||||
copyIn['compile.sh'] ? '/bin/bash compile.sh' : lang.compile,
|
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 (status !== STATUS.STATUS_ACCEPTED) throw new CompileError({ status, stdout, stderr });
|
||||||
if (!fileIds[target]) throw new CompileError({ stderr: 'Executable file not found.' });
|
if (!fileIds[target]) throw new CompileError({ stderr: 'Executable file not found.' });
|
||||||
|
|||||||
Reference in new issue
Block a user