mirror of
https://github.com/react/react-native.git
synced 2026-09-29 16:58:04 +08:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54707 Changelog: [Internal] Reviewed By: cortinico Differential Revision: D87929652 fbshipit-source-id: 439eef5eea9b9203cf2a7b5a8eae38d83e192bd5
27 lines
927 B
JavaScript
27 lines
927 B
JavaScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
// @flow
|
|
const { execSync } = require('child_process');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
function main() {
|
|
const packageJsonPath = path.join(__dirname, '../packages/react-native/package.json');
|
|
const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, 'utf8'));
|
|
const hermesCompilerVersion = packageJson.dependencies['hermes-compiler'];
|
|
|
|
if (hermesCompilerVersion === '0.0.0') {
|
|
console.log(`Hermes compiler version not set. Updating to the latest nightly release.`);
|
|
execSync('yarn workspace react-native add hermes-compiler@nightly --exact', { stdio: 'inherit' });
|
|
} else {
|
|
console.log(`Hermes compiler version set to ${hermesCompilerVersion}. Not setting nightly hermes.`);
|
|
}
|
|
}
|
|
|
|
main();
|