From 16786989b4c5bd33a0cc9c7717dee57000e6be2a Mon Sep 17 00:00:00 2001 From: Riccardo Cipolleschi Date: Tue, 19 Jul 2022 09:30:13 -0700 Subject: [PATCH] Avoid copying folders that are not present in CI Summary: This Diff is a copy of this [PR](https://github.com/facebook/react-native/pull/34223) that we have against 0.69-stable. This Diff introduces some checks to prevent that we try to copy folders that are not present. ## Changelog Avoid copying the folders when they are not there. [General] [Changed] - When preparing the Hermes workspace, we don't copy the folders that are not present. Differential Revision: D37961092 fbshipit-source-id: f52f73a53a93dcb549d5c5cbf714e3ba242ada9a --- .circleci/config.yml | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index fee64be10324af..90e726ab1f028c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -899,8 +899,17 @@ jobs: name: Download Hermes tarball command: | node scripts/hermes/prepare-hermes-for-build - cp sdks/download/* $HERMES_WS_DIR/download/. - cp -r sdks/hermes/* $HERMES_WS_DIR/hermes/. + + # If Hermes is not built from source, we don't have these folders. + DOWNLOAD_FOLDER=sdks/download/ + if [[ -d $DOWNLOAD_FOLDER ]]; then + cp $DOWNLOAD_FOLDER* $HERMES_WS_DIR/download/. + fi + + HERMES_FOLDER=sdks/hermes/ + if [[ -d $HERMES_FOLDER ]]; then + cp -r $HERMES_FOLDER* $HERMES_WS_DIR/hermes/. + fi - save_cache: key: *hermes_cache_key paths: