(command: string, args: string[])
| 73 | } |
| 74 | |
| 75 | async 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 | |
| 93 | export async function executeDirect( |
| 94 | command: string, |
no test coverage detected