Verbose cocoapods output if error or flutter is verbose (#11048)

* Output verbose cocoapods output when pod install has an error or if flutter build/run is in -v

* remove repeated stdout
This commit is contained in:
xster 2017-06-30 11:17:48 -07:00 committed by GitHub
parent e5009e8827
commit c1e3b75cc2

View file

@ -437,14 +437,23 @@ Future<Null> _runPodInstall(Directory bundle, String engineDirectory) async {
}
final Status status = logger.startProgress('Running pod install...', expectSlowOperation: true);
final ProcessResult result = await processManager.run(
<String>['pod', 'install'],
workingDirectory: bundle.path,
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': engineDirectory},
<String>['pod', 'install', '--verbose'],
workingDirectory: bundle.path,
environment: <String, String>{'FLUTTER_FRAMEWORK_DIR': engineDirectory},
);
status.stop();
if (result.exitCode != 0) {
throwToolExit('Error running pod install:\n${result.stdout}');
if (logger.isVerbose || result.exitCode != 0) {
if (result.stdout.isNotEmpty) {
printStatus('CocoaPods\' output:\n');
printStatus(result.stdout, indent: 4);
}
if (result.stderr.isNotEmpty) {
printStatus('Error output from CocoaPods:\n');
printStatus(result.stderr, indent: 4);
}
}
if (result.exitCode != 0)
throwToolExit('Error running pod install');
}
}