Fix revision bundling

Summary:
This fixes headless not terminating due to the `package.json` not being readable.
I instead write this to the `global` object in the same way that the version is
set.

Reviewed By: jknoxville

Differential Revision: D14579316

fbshipit-source-id: 238afe912366c423552305e120088f4abac4c20b
This commit is contained in:
Pascal Hartig
2019-03-22 10:35:30 -07:00
committed by Facebook Github Bot
parent 57a24769e8
commit 939cc531e2
5 changed files with 26 additions and 14 deletions

View File

@@ -7,14 +7,15 @@
const path = require('path');
const fs = require('fs-extra');
const builder = require('electron-builder');
const cp = require('child-process-es6-promise');
const Platform = builder.Platform;
const cp = require('child-process-es6-promise');
const {
buildFolder,
compile,
die,
compileDefaultPlugins,
getVersionNumber,
genMercurialRevision,
} = require('./build-utils.js');
function generateManifest(versionNumber) {
@@ -31,14 +32,6 @@ function generateManifest(versionNumber) {
);
}
// Asynchronously determine current mercurial revision as string or `null` in case of any error.
function genMercurialRevision() {
return cp
.spawn('hg', ['log', '-r', '.', '-T', '{node}'])
.catch(err => null)
.then(res => (res && res.stdout) || null);
}
function modifyPackageManifest(buildFolder, versionNumber, hgRevision) {
// eslint-disable-next-line no-console
console.log('Creating package.json manifest');