@@ -5,7 +5,8 @@ Requirements:
5
5
1. npm i -g react-native-cli
6
6
2. npm i -g appcenter-cli
7
7
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
9
10
10
11
Usage: node create-app.js <appName> <reactNativeVersion> <reactNativeCodePushVersion>
11
12
1. node create-app.js
@@ -54,7 +55,7 @@ if (!isReactNativeVersionLowerThan(60) && process.platform === "darwin") {
54
55
execCommand ( "pod --version" ) ;
55
56
console . log ( "CocoaPods has installed" ) ;
56
57
} 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` ) ;
58
59
process . exit ( ) ;
59
60
}
60
61
}
@@ -114,7 +115,7 @@ function createCodePushApp(name, os) {
114
115
115
116
function generatePlainReactNativeApp ( appName , reactNativeVersion ) {
116
117
console . log ( `Installing React Native...` ) ;
117
- execCommand ( `react-native init ${ appName } --version ${ reactNativeVersion } ` ) ;
118
+ execCommand ( `react-native init ${ appName } --version ${ reactNativeVersion . split ( '@' ) [ 1 ] } ` ) ;
118
119
console . log ( `React Native has been installed \n` ) ;
119
120
}
120
121
@@ -306,7 +307,6 @@ function iosSetup() {
306
307
const codePushBundleUrl = "[CodePush bundleURL]" ;
307
308
appDelegateContents = appDelegateContents . replace ( oldBundleUrl , codePushBundleUrl ) ;
308
309
fs . writeFileSync ( appDelegatePath , appDelegateContents ) ;
309
-
310
310
execCommand ( `cd ios && pod install && cd ..` ) ;
311
311
}
312
312
0 commit comments