2017-03-02 13:13:18 +00:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
ios_dir=`pwd`/ios
|
|
|
|
if [ -d ios_dir ]
|
|
|
|
then
|
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
podfile="$ios_dir/Podfile"
|
2017-06-12 12:26:39 +00:00
|
|
|
template=`pwd`/node_modules/react-native-firebase/ios/Podfile.template
|
2017-03-17 14:57:22 +00:00
|
|
|
|
|
|
|
project_name=$(node -pe "require('./package.json').name")
|
2017-03-02 13:13:18 +00:00
|
|
|
|
2017-03-17 14:57:22 +00:00
|
|
|
echo "Checking Podfile in iOS project $project_name ($podfile)"
|
2017-03-02 13:13:18 +00:00
|
|
|
|
|
|
|
if [ -f $podfile ]
|
|
|
|
then
|
|
|
|
echo ""
|
|
|
|
echo "Found an existing Podfile, Do you want to override it? [N/y]"
|
|
|
|
read generate_env_file
|
|
|
|
|
|
|
|
if [ "$generate_env_file" != "y" ]
|
|
|
|
then
|
|
|
|
echo "Add the following pods":
|
|
|
|
echo ""
|
|
|
|
echo ""
|
|
|
|
cat $template
|
|
|
|
echo ""
|
|
|
|
echo ""
|
2017-03-10 14:18:01 +00:00
|
|
|
echo "and run 'pod install' to install RNFirebase for iOS"
|
2017-03-02 13:13:18 +00:00
|
|
|
exit 0
|
|
|
|
fi
|
|
|
|
|
|
|
|
rm -f $podfile
|
|
|
|
rm -f "$podfile.lock"
|
|
|
|
fi
|
|
|
|
|
|
|
|
echo "Adding Podfile to iOS project"
|
|
|
|
|
2017-03-17 14:57:22 +00:00
|
|
|
touch ios/Podfile
|
|
|
|
cat >ios/Podfile <<EOL
|
|
|
|
target '${project_name}' do
|
|
|
|
# Uncomment the next line if you're using Swift or would like to use dynamic frameworks
|
|
|
|
# use_frameworks!
|
|
|
|
# Pods for '${project_name}'
|
|
|
|
end
|
|
|
|
|
|
|
|
# RNFirebase
|
|
|
|
pod 'Firebase/Auth'
|
|
|
|
pod 'Firebase/Analytics'
|
|
|
|
pod 'Firebase/AppIndexing'
|
|
|
|
pod 'Firebase/Core'
|
|
|
|
pod 'Firebase/Crash'
|
|
|
|
pod 'Firebase/Database'
|
|
|
|
pod 'Firebase/DynamicLinks'
|
|
|
|
pod 'Firebase/Messaging'
|
|
|
|
pod 'Firebase/RemoteConfig'
|
|
|
|
pod 'Firebase/Storage'
|
|
|
|
EOL
|
2017-03-02 13:13:18 +00:00
|
|
|
|
|
|
|
echo "Installing Pods"
|
|
|
|
|
|
|
|
pod install --project-directory=ios
|