From fc1dbb8f0be19d83653566e9b4340785350c7aba Mon Sep 17 00:00:00 2001 From: Dmitry Rykun Date: Tue, 22 Nov 2022 15:39:18 +0000 Subject: [PATCH] [LOCAL] fix copy-hermes-xcode.sh --- sdks/hermes-engine/utils/copy-hermes-xcode.sh | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/sdks/hermes-engine/utils/copy-hermes-xcode.sh b/sdks/hermes-engine/utils/copy-hermes-xcode.sh index 6768d4ecb28ed0..1b14941e6a14b3 100755 --- a/sdks/hermes-engine/utils/copy-hermes-xcode.sh +++ b/sdks/hermes-engine/utils/copy-hermes-xcode.sh @@ -6,9 +6,17 @@ set -x -source="${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/${PLATFORM_NAME}/hermes.framework" +src="${PODS_ROOT}/hermes-engine/destroot/Library/Frameworks/${PLATFORM_NAME}/hermes.framework" -if [[ -f "$source" ]]; then - cp -R "$source" "${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes/hermes.framework" - cp -R "$source" "${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +if [[ ! -e "$src" ]]; then + echo "$src does not exist." + exit 1 fi + +dst1="${PODS_XCFRAMEWORKS_BUILD_DIR}/hermes" +[ ! -f "$dst1" ] && mkdir -p "$dst1" +cp -R "$src" "$dst1" + +dst2="${TARGET_BUILD_DIR}/${FRAMEWORKS_FOLDER_PATH}" +[ ! -f "$dst2" ] && mkdir -p "$dst2" +cp -R "$src" "$dst2"