mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-21 01:46:28 +08:00
judge: pass envirent vars to checker
This commit is contained in:
1 parent
9158550139
commit
abec5fd3ec
11 files changed
+54
-47
No files matched your search
@@ -39,6 +39,7 @@ interface Parameter {
|
||||
copyOut?: string[];
|
||||
copyOutCached?: string[];
|
||||
cacheStdoutAndStderr?: boolean;
|
||||
env?: Record<string, string>;
|
||||
}
|
||||
|
||||
interface SandboxAdaptedResult {
|
||||
@@ -72,6 +73,7 @@ function proc({
|
||||
processLimit = getConfig('processLimit'),
|
||||
stdin = '', copyIn = {}, copyOut = [], copyOutCached = [],
|
||||
cacheStdoutAndStderr = false,
|
||||
env = {},
|
||||
}: Parameter = {}): Cmd {
|
||||
if (!supportOptional) {
|
||||
copyOut = (copyOut as string[]).map((i) => (i.endsWith('?') ? i.substr(0, i.length - 1) : i));
|
||||
@@ -84,7 +86,7 @@ function proc({
|
||||
}
|
||||
return {
|
||||
args: parseArgs(execute),
|
||||
env: getConfig('env').split('\n'),
|
||||
env: [...getConfig('env').split('\n'), ...Object.keys(env).map((i) => `${i}=${env[i].replace(/=/g, '\\=')}`)],
|
||||
files: [
|
||||
stdin ? { src: stdin } : { content: '' },
|
||||
{ name: 'stdout', max: Math.floor(1024 * 1024 * size) },
|
||||
|
||||
Reference in new issue
Block a user