From 8745a148b6d8358702b5300d73f4686c3aedb413 Mon Sep 17 00:00:00 2001 From: Nenad Vojnovic Date: Wed, 21 Sep 2022 03:40:44 -0700 Subject: [PATCH] Fix HERMES_ENABLED check in scripts/react-native-xcode.sh (#34675) Summary: Checking if Hermes is enabled is failing because there is no `podfile.lock` file in the directory where this script is executed and `USE_HERMES` will be set to `false` which will prevent building Hermes binary jsbundle. ## Changelog [iOS] [Fixed] - `HERMES_ENABLED` check fixed in react-native-xcode.sh Pull Request resolved: https://github.com/facebook/react-native/pull/34675 Test Plan: 1. Enable Hermes 2. Make a release build 3. Verify the `main.jsbundle` file is Hermes binary bundle Reviewed By: cortinico Differential Revision: D39686608 Pulled By: cipolleschi fbshipit-source-id: 237c77ced484d4ab77e576c7a2bb7b6826228017 --- scripts/react-native-xcode.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/react-native-xcode.sh b/scripts/react-native-xcode.sh index e822afd58f37dc..92c7e244912d01 100755 --- a/scripts/react-native-xcode.sh +++ b/scripts/react-native-xcode.sh @@ -78,11 +78,11 @@ fi # shellcheck source=/dev/null source "$REACT_NATIVE_DIR/scripts/node-binary.sh" -# If hermes-engine is in the podfile.lock, it means that Hermes is a dependency of the project +# If hermes-engine is in the Podfile.lock, it means that Hermes is a dependency of the project # and it is enabled. If not, it means that hermes is disabled. -HERMES_ENABLED=$(grep hermes-engine podfile.lock) +HERMES_ENABLED=$(grep hermes-engine $PODS_PODFILE_DIR_PATH/Podfile.lock) -# If hermes-engine is not in the podfile.lock, it means that the app is not using Hermes. +# If hermes-engine is not in the Podfile.lock, it means that the app is not using Hermes. # Setting USE_HERMES is no the only way to set whether the app can use hermes or not: users # can also modify manually the Podfile. if [[ -z "$HERMES_ENABLED" ]]; then