Как получить выход console.log () из дочернего процесса в execa? - PullRequest
1 голос
/ 11 июня 2019

Ниже кода запускается приложение 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 ?

...