-
-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add postinstall script to fix FBReactNativeSpec hash change
The hash in Podfile.lock keep changing on different developer machines. That is because the file the hash is based on contains absolute paths. See facebook/react-native#31193 for more info. This commit adds a postinstall script that fixes that bug.
- Loading branch information
Showing
3 changed files
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#!/bin/bash | ||
|
||
OS=`uname` | ||
|
||
echo "Fixing RN 0.64.0 bugs:" | ||
cd node_modules/react-native/scripts | ||
echo "- unset PREFIX in find-node.sh" | ||
if [ `cat find-node.sh | grep 'unset PREFIX' | wc -l` -lt 1 ] | ||
then | ||
cp find-node.sh tmp | ||
head -n 1 tmp >find-node.sh | ||
echo "unset PREFIX" >>find-node.sh | ||
tail -n +2 tmp >>find-node.sh | ||
rm tmp | ||
fi | ||
|
||
if [ "$OS" = 'Darwin' ] | ||
then | ||
# for MacOS; cannot install Pods on Win/Linux | ||
echo "- switch to relative paths in react_native_pods.rb " | ||
sed -i '' -e "s/File[.]join[(]__dir__, \"[.][.]\"[)]/\"..\/..\/node_modules\/react-native\"/" react_native_pods.rb | ||
sed -i '' -e "s/#{File[.]join[(]__dir__, \"generate-specs.sh\"[)]}/..\/..\/node_modules\/react-native\/scripts\/generate-specs.sh/" react_native_pods.rb | ||
sed -i '' -e "s/spec[.]prepare_command = \"#/spec.prepare_command = \"cd ..\/.. \&\& #/" react_native_pods.rb | ||
fi | ||
|
||
cd - >/dev/null |