You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/cli/src/commands/init/init.ts
+33-23Lines changed: 33 additions & 23 deletions
Original file line number
Diff line number
Diff line change
@@ -291,43 +291,53 @@ async function createFromTemplate({
291
291
if(process.platform==='darwin'){
292
292
constinstallPodsValue=String(installCocoaPods);
293
293
294
-
if(installPodsValue==='true'){
295
-
didInstallPods=true;
296
-
awaitinstallPods(loader);
297
-
loader.succeed();
298
-
setEmptyHashForCachedDependencies(projectName);
299
-
}elseif(installPodsValue==='undefined'){
300
-
const{installCocoapods}=awaitprompt({
301
-
type: 'confirm',
302
-
name: 'installCocoapods',
303
-
message: `Do you want to install CocoaPods now? ${chalk.reset.dim(
304
-
'Only needed if you run your project in Xcode directly',
305
-
)}`,
306
-
});
307
-
didInstallPods=installCocoapods;
308
-
309
-
if(installCocoapods){
294
+
try{
295
+
if(installPodsValue==='true'){
296
+
didInstallPods=true;
310
297
awaitinstallPods(loader);
311
298
loader.succeed();
312
299
setEmptyHashForCachedDependencies(projectName);
300
+
}elseif(installPodsValue==='undefined'){
301
+
const{installCocoapods}=awaitprompt({
302
+
type: 'confirm',
303
+
name: 'installCocoapods',
304
+
message: `Do you want to install CocoaPods now? ${chalk.reset.dim(
305
+
'Only needed if you run your project in Xcode directly',
306
+
)}`,
307
+
});
308
+
didInstallPods=installCocoapods;
309
+
310
+
if(installCocoapods){
311
+
awaitinstallPods(loader);
312
+
loader.succeed();
313
+
setEmptyHashForCachedDependencies(projectName);
314
+
}
313
315
}
316
+
}catch(error){
317
+
logger.error(
318
+
`Installing Cocoapods failed. This doesn't affect project initialization and you can safely proceed. However, you will need to install Cocoapods manually when running iOS, follow additional steps in "Run instructions for iOS" section.\n\nError: ${
'Installing pods failed. This doesn\'t affect project initialization and you can safely proceed. \nHowever, you will need to install pods manually when running iOS, follow additional steps in "Run instructions for iOS" section.\n',
0 commit comments