From 7153dfe64881c518e09595b914bb4fe971ec8efc Mon Sep 17 00:00:00 2001 From: Tommy Nguyen <4123478+tido64@users.noreply.github.com> Date: Wed, 25 May 2022 14:11:46 +0200 Subject: [PATCH] Fix `pod install --project-directory=ios` failing when Hermes is enabled --- scripts/react_native_pods.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/react_native_pods.rb b/scripts/react_native_pods.rb index 8db56d769f1074..4afa1038c97604 100644 --- a/scripts/react_native_pods.rb +++ b/scripts/react_native_pods.rb @@ -3,6 +3,7 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. +require 'open3' require 'pathname' require_relative './react_native_pods_utils/script_phases.rb' @@ -109,7 +110,12 @@ def use_react_native! (options={}) end if hermes_enabled - system("(cd #{prefix} && node scripts/hermes/prepare-hermes-for-build)") + prepare_hermes = 'node scripts/hermes/prepare-hermes-for-build' + react_native_dir = Pod::Config.instance.installation_root.join(prefix) + prep_output, prep_status = Open3.capture2e(prepare_hermes, :chdir => react_native_dir) + prep_output.split("\n").each { |line| Pod::UI.info line } + abort unless prep_status == 0 + pod 'React-hermes', :path => "#{prefix}/ReactCommon/hermes" pod 'hermes-engine', :path => "#{prefix}/sdks/hermes/hermes-engine.podspec" pod 'libevent', '~> 2.1.12'