Skip to content

Commit

Permalink
Change location of iOS build cache directory to ~/Library/Caches/ (#2…
Browse files Browse the repository at this point in the history
…2688)

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
  • Loading branch information
sryze authored and facebook-github-bot committed Jan 25, 2019
1 parent 103880b commit 1024dc2
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions scripts/ios-install-third-party.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

cachedir="$HOME/.rncache"
if [ -d "$HOME/.rncache" ]; then
cachedir="$HOME/.rncache" # react-native 0.57.8 and older
else
cachedir="$HOME/Library/Caches/com.facebook.ReactNativeBuild"
fi
mkdir -p "$cachedir"

function file_fail () {
cachefile=$1
msg=$2

echo "$msg. Debug info:" 2>&1
echo "$msg. Debug info:" 2>&1
ls -l "$cachefile" 2>&1
shasum "$cachefile" 2>&1
exit 1
Expand All @@ -29,7 +33,7 @@ function fetch_and_unpack () {
while true; do
if [ -f "$cachedir/$file" ]; then
if shasum -p "$cachedir/$file" |
awk -v hash="$hash" '{exit $1 != hash}'; then
awk -v hash="$hash" '{exit $1 != hash}'; then
break
else
echo "Incorrect hash:" 2>&1
Expand Down

0 comments on commit 1024dc2

Please sign in to comment.