MCPcopy Index your code
hub / github.com/compiler-explorer/compiler-explorer / execute

Function execute

lib/exec.ts:671–683  ·  view source on GitHub ↗
(
    command: string,
    args: string[],
    options: ExecutionOptions,
)

Source from the content-addressed store, hash-verified

669};
670
671export async function execute(
672 command: string,
673 args: string[],
674 options: ExecutionOptions,
675): Promise<UnprocessedExecResult> {
676 checkExecOptions(options);
677 const type = execProps('executionType', 'none');
678 const dispatchEntry = executeDispatchTable[type];
679 if (!dispatchEntry) throw new Error(`Bad sandbox type ${type}`);
680 if (!command) throw new Error('No executable provided');
681 const unbuffered = await maybeUnbuffer(command, args);
682 return await dispatchEntry(unbuffered.command, unbuffered.args, options);
683}
684
685export function maybeRemapJailedDir(customCwd: string): string {
686 return execProps('executionType', 'none') == 'nsjail' ? jailedHomeDir : customCwd;

Callers

nothing calls this directly

Calls 2

checkExecOptionsFunction · 0.85
maybeUnbufferFunction · 0.85

Tested by

no test coverage detected