diff --git a/scripts/ios-install-third-party.sh b/scripts/ios-install-third-party.sh index 4b64c70c236..6638acbcdb7 100755 --- a/scripts/ios-install-third-party.sh +++ b/scripts/ios-install-third-party.sh @@ -4,7 +4,9 @@ # This source code is licensed under the MIT license found in the # LICENSE file in the root directory of this source tree. -if [ -d "$HOME/.rncache" ]; then +if [ -n "$RN_CACHE_DIR" ] && [ -d "$RN_CACHE_DIR" ]; then + cachedir="$RN_CACHE_DIR" +elif [ -d "$HOME/.rncache" ]; then cachedir="$HOME/.rncache" # react-native 0.57.8 and older else cachedir="$HOME/Library/Caches/com.facebook.ReactNativeBuild"