@@ -5,7 +5,8 @@ Requirements:
55 1. npm i -g react-native-cli
66 2. npm i -g appcenter-cli
77 3. appcenter login
8- (If you use this script on macOS for react-native v0.60+ then you need to have CocoaPods installed)
8+ 4. If you use this script on macOS for react-native v0.60+ then you need to have CocoaPods installed. Use this command to (re)install CocoaPods:
9+ sudo gem install cocoapods -n /usr/local/bin
910
1011Usage: node create-app.js <appName> <reactNativeVersion> <reactNativeCodePushVersion>
1112 1. node create-app.js
@@ -54,7 +55,7 @@ if (!isReactNativeVersionLowerThan(60) && process.platform === "darwin") {
5455 execCommand ( "pod --version" ) ;
5556 console . log ( "CocoaPods has installed" ) ;
5657 } catch {
57- console . error ( `'CocoaPods' are required to run the script, you can install it with\n'sudo gem install cocoapods'\ncommand` ) ;
58+ console . error ( `'CocoaPods' are required to run the script, you can install it with\n'sudo gem install cocoapods -n /usr/local/bin '\ncommand` ) ;
5859 process . exit ( ) ;
5960 }
6061}
@@ -114,7 +115,7 @@ function createCodePushApp(name, os) {
114115
115116function generatePlainReactNativeApp ( appName , reactNativeVersion ) {
116117 console . log ( `Installing React Native...` ) ;
117- execCommand ( `react-native init ${ appName } --version ${ reactNativeVersion } ` ) ;
118+ execCommand ( `react-native init ${ appName } --version ${ reactNativeVersion . split ( '@' ) [ 1 ] } ` ) ;
118119 console . log ( `React Native has been installed \n` ) ;
119120}
120121
@@ -306,7 +307,6 @@ function iosSetup() {
306307 const codePushBundleUrl = "[CodePush bundleURL]" ;
307308 appDelegateContents = appDelegateContents . replace ( oldBundleUrl , codePushBundleUrl ) ;
308309 fs . writeFileSync ( appDelegatePath , appDelegateContents ) ;
309-
310310 execCommand ( `cd ios && pod install && cd ..` ) ;
311311}
312312
0 commit comments