From bf6b6e188dd7226e893fd90aeb1c7c8f1241a7ed Mon Sep 17 00:00:00 2001 From: Chris Bracken Date: Wed, 8 Mar 2017 16:42:31 -0800 Subject: [PATCH] Check for CocoaPods installation if required (#8666) --- packages/flutter_tools/lib/src/ios/mac.dart | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/flutter_tools/lib/src/ios/mac.dart b/packages/flutter_tools/lib/src/ios/mac.dart index aa3e8c8ce6b..9e85f8bc538 100644 --- a/packages/flutter_tools/lib/src/ios/mac.dart +++ b/packages/flutter_tools/lib/src/ios/mac.dart @@ -317,8 +317,18 @@ bool _checkXcodeVersion() { return true; } +bool _checkCocoaPodsInstalled() { + if (!platform.isMacOS) + return false; + return exitsHappy(['pod', '--version']); +} + void _installCocoaPods(Directory bundle, String engineDirectory) { if (fs.file(fs.path.join(bundle.path, 'Podfile')).existsSync()) { + if (!_checkCocoaPodsInstalled()) { + printError('Warning: CocoaPods not installed. Not running pod install.'); + return; + } runCheckedSync( ['pod', 'install'], workingDirectory: bundle.path,