From ada9cace1dbbf66607fe8144cad00b53b885dac5 Mon Sep 17 00:00:00 2001 From: Lukas Geiger Date: Mon, 10 Apr 2017 07:45:11 +0200 Subject: [PATCH] fix(rebuild): Log stdout and stderr (#1450) This logs the output of the rebuild process to help debug build failures like #1415 --- packages/electron-builder/src/yarn.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/electron-builder/src/yarn.ts b/packages/electron-builder/src/yarn.ts index 662486a70a0..a989c32c4ba 100644 --- a/packages/electron-builder/src/yarn.ts +++ b/packages/electron-builder/src/yarn.ts @@ -71,6 +71,7 @@ function installDependencies(appDir: string, frameworkInfo: DesktopFrameworkInfo return spawn(execPath, execArgs, { cwd: appDir, env: getGypEnv(frameworkInfo, platform, arch, buildFromSource), + stdio: ["pipe", process.stdout, process.stderr] }) } @@ -114,7 +115,11 @@ export async function rebuild(appDir: string, frameworkInfo: DesktopFrameworkInf execArgs.push(...additionalArgs) await BluebirdPromise.each(nativeDeps, dep => { log(`Rebuilding native dependency ${dep.name}`) - return spawn(execPath, execArgs, {cwd: dep.path, env: env}) + return spawn(execPath, execArgs, { + cwd: dep.path, + env: env, + stdio: ["pipe", process.stdout, process.stderr] + }) .catch(error => { if (dep.optional) { warn(`Cannot build optional native dep ${dep.name}`) @@ -129,6 +134,10 @@ export async function rebuild(appDir: string, frameworkInfo: DesktopFrameworkInf execArgs.push("rebuild") execArgs.push(...additionalArgs) execArgs.push(...nativeDeps.map(it => it.name)) - await spawn(execPath, execArgs, {cwd: appDir, env: env}) + await spawn(execPath, execArgs, { + cwd: appDir, + env: env, + stdio: ["pipe", process.stdout, process.stderr] + }) } }