Skip to content
This repository was archived by the owner on May 20, 2025. It is now read-only.

Commit b46b3e0

Browse files
Fix creating app with script (#1956)
* Added installing Cocoapods for MasOS to script * Fixed installing cocoapods * Moved checking that CocoaPods installed * Fixed error with reactNativeVersion * Removed old code * Fixed error message
1 parent 3541be2 commit b46b3e0

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

Examples/create-app.js

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,24 @@ try {
4141
process.exit();
4242
}
4343

44+
const appNameAndroid = `${appName}-android`;
45+
const appNameIOS = `${appName}-ios`;
46+
let owner = null;
47+
const reactNativeVersion = args[1] || `react-native@${execCommand('npm view react-native version')}`.trim();
48+
const reactNativeVersionIsLowerThanV049 = isReactNativeVersionLowerThan(49);
49+
const reactNativeCodePushVersion = args[2] || `react-native-code-push@${execCommand('npm view react-native-code-push version')}`.trim();
50+
4451
if (!isReactNativeVersionLowerThan(60) && process.platform === "darwin") {
4552
try {
4653
console.log("Verify that CocoaPods installed");
4754
execCommand("pod --version");
4855
console.log("CocoaPods has installed");
4956
} catch {
50-
console.error(`'CocoaPods' are required to run the script, you can install it with\n'sudo gem install cocoapods'\ncommand
51-
`);
57+
console.error(`'CocoaPods' are required to run the script, you can install it with\n'sudo gem install cocoapods'\ncommand`);
5258
process.exit();
5359
}
5460
}
5561

56-
const appNameAndroid = `${appName}-android`;
57-
const appNameIOS = `${appName}-ios`;
58-
let owner = null;
59-
const reactNativeVersion = args[1] || `react-native@${execCommand('npm view react-native version')}`.trim();
60-
const reactNativeVersionIsLowerThanV049 = isReactNativeVersionLowerThan(49);
61-
const reactNativeCodePushVersion = args[2] || `react-native-code-push@${execCommand('npm view react-native-code-push version')}`.trim();
62-
6362
console.log(`App name: ${appName}`);
6463
console.log(`React Native version: ${reactNativeVersion}`);
6564
console.log(`React Native Module for CodePush version: ${reactNativeCodePushVersion} \n`);

0 commit comments

Comments
 (0)