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

@@ -23,6 +23,10 @@ const getPackageJSON = async () => {
export const readCurrentRevision: () => Promise<?string> = lodash.memoize(
async () => {
// This is provided as part of the bundling process for headless.
if (global.__REVISION__) {
return global.__REVISION__;
}
const json = await getPackageJSON();
return json.revision;
},