Ниже кода запускается приложение Electron, однако console.log()
из основного процесса будет недоступно.
import executeExternalCommand, { ExecaReturnValue } from 'execa';
async startInitializeProjectGUI(): Promise<void> {
const executionResult: ExecaReturnValue<string> = await executeExternalCommand(
'electron',
['InitializeProject_GUI.js'], // console.log() is here
{ cwd: __dirname }
);
if (executionResult.failed) {
Promise.reject(new Error('Can not start "electron"'));
}
return;
}
Как получить консольный вывод дочернего процесса с execa ?