1

Below code starts Electron application, however, console.log() from the main process will not be available.

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;
}

How can I get console output of child process with execa?

Takeshi Tokugawa YD
  • 670
  • 5
  • 40
  • 124

0 Answers0