Skip to content
Permalink
Browse files

fix(packager): output rebuild errors if there are any

  • Loading branch information
MarshallOfSound authored and malept committed Dec 11, 2016
1 parent ed9137d commit f8ffca1398b7cc4e768a02e0b8f1a25064ef42ef
Showing with 4 additions and 2 deletions.
  1. +4 −2 src/util/rebuild.js
@@ -43,7 +43,6 @@ export default async (buildPath, electronVersion, pPlatform, pArch) => {
await new Promise((resolve, reject) => {
const child = spawn(process.execPath, [path.resolve(__dirname, '../../node_modules/.bin/node-gyp')].concat(rebuildArgs), {
cwd: modulePath,
// stdio: 'inherit',
env: Object.assign({}, process.env, {
HOME: path.resolve(os.homedir(), '.electron-gyp'),
USERPROFILE: path.resolve(os.homedir(), '.electron-gyp'),
@@ -54,9 +53,12 @@ export default async (buildPath, electronVersion, pPlatform, pArch) => {
npm_config_build_from_source: true,
}),
});
let output = '';
child.stdout.on('data', (data) => { output += data; });
child.stderr.on('data', (data) => { output += data; });
child.on('exit', async (code) => {
d('built:', path.basename(modulePath));
if (code !== 0) return reject(new Error(`Failed to rebuild: ${modulePath}`));
if (code !== 0) return reject(new Error(`Failed to rebuild: ${modulePath}\n\n${output}`));
await pify(mkdirp)(path.dirname(metaPath));
await fs.writeFile(metaPath, pArch);
resolve();

0 comments on commit f8ffca1

Please sign in to comment.
You can’t perform that action at this time.