Skip to content

Commit 09c9541

Browse files
cipolleschifacebook-github-bot
authored andcommitted
Use fileExists in replace_hermes script (#37911)
Summary: Pull Request resolved: #37911 Thanks to [adrianha](https://github.com/adrianha) for spotting a bug in the script that replace the Hermes engine. I miscopied the variable to check when there is no previous build file. This change uses the right variable and improves also the messages printed to the user. ## Changelog: [Internal] - Fix replace_hermes_version script using the right `fileExists` variable Reviewed By: dmytrorykun Differential Revision: D46762041 fbshipit-source-id: fdf3da6a598ecc657ee9313a2fa41e71c01d14ce
1 parent 7d4f233 commit 09c9541

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

packages/react-native/sdks/hermes-engine/utils/replace_hermes_version.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,17 @@ function shouldReplaceHermesConfiguration(configuration) {
3434
console.log(`Found ${LAST_BUILD_FILENAME} file`);
3535
const oldConfiguration = fs.readFileSync(LAST_BUILD_FILENAME).toString();
3636
if (oldConfiguration === configuration) {
37-
console.log('No need to download a new build of Hermes!');
37+
console.log(
38+
'Same config of the previous build. No need to replace Hermes engine',
39+
);
3840
return false;
3941
}
4042
}
4143

4244
// Assumption: if there is no stored last build, we assume that it was build for debug.
43-
if (!fs.existsSync && configuration === 'Debug') {
45+
if (!fileExists && configuration === 'Debug') {
4446
console.log(
45-
'File does not exists, but Debug configuration. No need to download a new build of Hermes!',
47+
'No previous build detected, but Debug Configuration. No need to replace Hermes engine',
4648
);
4749
return false;
4850
}

0 commit comments

Comments
 (0)