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

Function maybeUnbuffer

lib/exec.ts:75–91  ·  view source on GitHub ↗
(command: string, args: string[])

Source from the content-addressed store, hash-verified

73}
74
75async function maybeUnbuffer(command: string, args: string[]): Promise<{command: string; args: string[]}> {
76 if (!stdbufPath) {
77 const unbufferStdoutExe = execProps<string>('unbufferStdoutExe');
78 if (unbufferStdoutExe) {
79 stdbufPath = await which(unbufferStdoutExe).catch(() => null);
80 if (!stdbufPath) logger.error(`Could not find ${unbufferStdoutExe} in PATH`);
81 else logger.info(`Unbuffering with ${stdbufPath}`);
82 }
83 }
84
85 if (stdbufPath) {
86 const stdbufArgs = splitArguments(execProps<string>('unbufferStdoutArgs'));
87 logger.debug(`Unbuffering ${command} with ${stdbufPath} ${stdbufArgs.join(' ')}`);
88 return {command: stdbufPath, args: stdbufArgs.concat([command], args)};
89 }
90 return {command, args};
91}
92
93export async function executeDirect(
94 command: string,

Callers 2

sandboxFunction · 0.85
executeFunction · 0.85

Calls 2

splitArgumentsFunction · 0.85
errorMethod · 0.80

Tested by

no test coverage detected