Skip to content
This repository was archived by the owner on Jan 13, 2023. It is now read-only.

Commit 6648fea

Browse files
authored
fix(cli): Verify cocoapods is installed, if RN >= 0.60 and not Expo (#333 by @bryanstearns)
1 parent c202493 commit 6648fea

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/boilerplate.ts

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export const install = async (toolbox: IgniteToolbox) => {
4040
const { red, yellow, bold, gray, cyan } = colors
4141
const isWindows = process.platform === "win32"
4242
const isMac = process.platform === "darwin"
43+
const reactNativeVersion = getReactNativeVersion(toolbox)
4344

4445
if (parameters.options["dry-run"]) return
4546

@@ -86,6 +87,18 @@ export const install = async (toolbox: IgniteToolbox) => {
8687

8788
let includeDetox = false
8889
if (isMac && !useExpo) {
90+
const isCocoapodsInstalled = await system.which(`pod`)
91+
if (!isCocoapodsInstalled && reactNativeVersion >= "0.60") {
92+
print.error(`
93+
Error: Cocoapods is not installed, but is required for React Native
94+
0.60 or later, when not using Expo.
95+
96+
More info here: https://reactnative.dev/docs/environment-setup
97+
And here: https://guides.cocoapods.org/using/getting-started.html
98+
`)
99+
process.exit(1)
100+
}
101+
89102
const askAboutDetox = parameters.options.detox === undefined
90103
includeDetox = askAboutDetox
91104
? await prompt.confirm("Would you like to include Detox end-to-end tests?")
@@ -121,7 +134,7 @@ export const install = async (toolbox: IgniteToolbox) => {
121134
} else {
122135
rnInstall = await reactNative.install({
123136
name,
124-
version: getReactNativeVersion(toolbox),
137+
version: reactNativeVersion,
125138
useNpm: !ignite.useYarn,
126139
})
127140

0 commit comments

Comments
 (0)