Skip to content

Commit 1024dc2

Browse files
sryzefacebook-github-bot
authored andcommitted
Change location of iOS build cache directory to ~/Library/Caches/ (#22688)
Summary: Instead of using ~/.rncache use the special Caches directory designed for caching files. This fixes #21780. Changelog: ---------- [iOS] [Changed] - Moved iOS build cache directory from ~/.rncache to ~/Library/Caches/com.facebook.ReactNativeBuild Pull Request resolved: #22688 Differential Revision: D13817171 Pulled By: cpojer fbshipit-source-id: af03dda66f9d49f4fe88bd050b359ccb7abb889a
1 parent 103880b commit 1024dc2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/ios-install-third-party.sh

+7-3
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,18 @@
44
# This source code is licensed under the MIT license found in the
55
# LICENSE file in the root directory of this source tree.
66

7-
cachedir="$HOME/.rncache"
7+
if [ -d "$HOME/.rncache" ]; then
8+
cachedir="$HOME/.rncache" # react-native 0.57.8 and older
9+
else
10+
cachedir="$HOME/Library/Caches/com.facebook.ReactNativeBuild"
11+
fi
812
mkdir -p "$cachedir"
913

1014
function file_fail () {
1115
cachefile=$1
1216
msg=$2
1317

14-
echo "$msg. Debug info:" 2>&1
18+
echo "$msg. Debug info:" 2>&1
1519
ls -l "$cachefile" 2>&1
1620
shasum "$cachefile" 2>&1
1721
exit 1
@@ -29,7 +33,7 @@ function fetch_and_unpack () {
2933
while true; do
3034
if [ -f "$cachedir/$file" ]; then
3135
if shasum -p "$cachedir/$file" |
32-
awk -v hash="$hash" '{exit $1 != hash}'; then
36+
awk -v hash="$hash" '{exit $1 != hash}'; then
3337
break
3438
else
3539
echo "Incorrect hash:" 2>&1

0 commit comments

Comments
 (0)