Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions packages/cli/src/tools/installPods.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ import inquirer from 'inquirer';
import commandExists from 'command-exists';
import {logger} from '@react-native-community/cli-tools';

const COCOAPODS_INSTALLATION_TIMEOUT = 30000;

async function installPods({
projectName,
loader,
Expand Down Expand Up @@ -41,6 +43,12 @@ async function installPods({
]);

if (shouldInstallCocoaPods) {
// Show a helpful notice when installation takes more than usually
const cocoaPodsInstallationTimeMessage = setTimeout(
() =>
logger.info('Installing CocoaPods, this may take a few minutes'),
COCOAPODS_INSTALLATION_TIMEOUT,
);
try {
// First attempt to install `cocoapods`
await execa('gem', ['install', 'cocoapods']);
Expand All @@ -57,6 +65,8 @@ async function installPods({
)}`,
);
}
} finally {
clearTimeout(cocoaPodsInstallationTimeMessage);
}

// This only shows when `CocoaPods` is automatically installed,
Expand Down