make flutter upgrade less verbose (#3237)

* more terse flutter upgrade

* fix an issue when updating and the engine update code has changed

* call flutter precache; add a --no-color hidden option

* fix a lint related to getters/setters
This commit is contained in:
Devon Carew
2016-04-11 11:17:09 -07:00
parent 47f5c6f2e0
commit 2a33e3f0c0
7 changed files with 72 additions and 20 deletions

View File

@@ -13,6 +13,10 @@ abstract class Logger {
String get separator => _sep;
set supportsColor(bool value) {
_terminal.supportsColor = value;
}
/// Display an error level message to the user. Commands should use this if they
/// fail in some way.
void printError(String message, [StackTrace stackTrace]);
@@ -195,14 +199,13 @@ class _AnsiTerminal {
_AnsiTerminal() {
// TODO(devoncarew): This detection does not work for Windows.
String term = Platform.environment['TERM'];
_supportsColor = term != null && term != 'dumb';
supportsColor = term != null && term != 'dumb';
}
static const String _bold = '\u001B[1m';
static const String _reset = '\u001B[0m';
bool _supportsColor;
bool get supportsColor => _supportsColor;
bool supportsColor;
String writeBold(String str) => supportsColor ? '$_bold$str$_reset' : str;
}

View File

@@ -15,7 +15,7 @@ typedef String StringConverter(String string);
/// This runs the command in the background from the specified working
/// directory. Completes when the process has been started.
Future<Process> runCommand(List<String> cmd, {String workingDirectory}) async {
Future<Process> runCommand(List<String> cmd, { String workingDirectory }) async {
printTrace(cmd.join(' '));
String executable = cmd[0];
List<String> arguments = cmd.length > 1 ? cmd.sublist(1) : [];