Commit 70e2acfb authored by Devon Carew's avatar Devon Carew Committed by GitHub

tweak the layout for the ios doctor checks (#9306)

parent ca5f0c9a
...@@ -271,10 +271,14 @@ class AnsiTerminal { ...@@ -271,10 +271,14 @@ class AnsiTerminal {
String bolden(String message) { String bolden(String message) {
if (!supportsColor) if (!supportsColor)
return message; return message;
final StringBuffer result = new StringBuffer(); final StringBuffer buffer = new StringBuffer();
for (String line in message.split('\n')) for (String line in message.split('\n'))
result.writeln('$_bold$line$_reset'); buffer.writeln('$_bold$line$_reset');
return result.toString(); final String result = buffer.toString();
// avoid introducing a new newline to the emboldened text
return (!message.endsWith('\n') && result.endsWith('\n'))
? result.substring(0, result.length - 1)
: result;
} }
String clearScreen() => supportsColor ? _clear : '\n\n'; String clearScreen() => supportsColor ? _clear : '\n\n';
......
...@@ -108,14 +108,9 @@ class Doctor { ...@@ -108,14 +108,9 @@ class Doctor {
/// Print verbose information about the state of installed tooling. /// Print verbose information about the state of installed tooling.
Future<bool> diagnose() async { Future<bool> diagnose() async {
bool firstLine = true;
bool doctorResult = true; bool doctorResult = true;
for (DoctorValidator validator in validators) { for (DoctorValidator validator in validators) {
if (!firstLine)
printStatus('');
firstLine = false;
final ValidationResult result = await validator.validate(); final ValidationResult result = await validator.validate();
if (result.type == ValidationType.missing) if (result.type == ValidationType.missing)
...@@ -134,6 +129,8 @@ class Doctor { ...@@ -134,6 +129,8 @@ class Doctor {
printStatus(' • $text'); printStatus(' • $text');
} }
} }
printStatus('');
} }
return doctorResult; return doctorResult;
......
...@@ -136,9 +136,9 @@ class IOSWorkflow extends DoctorValidator implements Workflow { ...@@ -136,9 +136,9 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'ideviceinstaller not available; this is used to discover connected iOS devices.\n' 'ideviceinstaller not available; this is used to discover connected iOS devices.\n'
'To install, run:\n' 'To install, run:\n'
'brew update\n' ' brew update\n'
'brew install --HEAD libimobiledevice\n' ' brew install --HEAD libimobiledevice\n'
'brew install ideviceinstaller' ' brew install ideviceinstaller'
)); ));
} }
...@@ -151,14 +151,14 @@ class IOSWorkflow extends DoctorValidator implements Workflow { ...@@ -151,14 +151,14 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
if (hasIosDeploy) { if (hasIosDeploy) {
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'ios-deploy out of date ($iosDeployMinimumVersion is required). To upgrade:\n' 'ios-deploy out of date ($iosDeployMinimumVersion is required). To upgrade:\n'
'brew update\n' ' brew update\n'
'brew upgrade ios-deploy' ' brew upgrade ios-deploy'
)); ));
} else { } else {
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'ios-deploy not installed. To install:\n' 'ios-deploy not installed. To install:\n'
'brew update\n' ' brew update\n'
'brew install ios-deploy' ' brew install ios-deploy'
)); ));
} }
} else { } else {
...@@ -169,9 +169,9 @@ class IOSWorkflow extends DoctorValidator implements Workflow { ...@@ -169,9 +169,9 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
brewStatus = ValidationType.partial; brewStatus = ValidationType.partial;
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'libimobiledevice is incompatible with the installed Xcode version. To update, run:\n' 'libimobiledevice is incompatible with the installed Xcode version. To update, run:\n'
'brew update\n' ' brew update\n'
'brew uninstall --ignore-dependencies libimobiledevice\n' ' brew uninstall --ignore-dependencies libimobiledevice\n'
'brew install --HEAD libimobiledevice' ' brew install --HEAD libimobiledevice'
)); ));
} }
} }
...@@ -182,16 +182,16 @@ class IOSWorkflow extends DoctorValidator implements Workflow { ...@@ -182,16 +182,16 @@ class IOSWorkflow extends DoctorValidator implements Workflow {
if (!hasCocoaPods) { if (!hasCocoaPods) {
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'CocoaPods not installed. To install:\n' 'CocoaPods not installed. To install:\n'
'brew update\n' ' brew update\n'
'brew install cocoapods\n' ' brew install cocoapods\n'
'pod setup' ' pod setup'
)); ));
} else { } else {
messages.add(new ValidationMessage.error( messages.add(new ValidationMessage.error(
'CocoaPods out of date ($cocoaPodsMinimumVersion is required). To upgrade:\n' 'CocoaPods out of date ($cocoaPodsMinimumVersion is required). To upgrade:\n'
'brew update\n' ' brew update\n'
'brew upgrade cocoapods\n' ' brew upgrade cocoapods\n'
'pod setup' ' pod setup'
)); ));
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment