Skip to content

Commit

Permalink
Merge pull request flutter#19 from dart-lang/cli_output_updates
Browse files Browse the repository at this point in the history
some updates to the output for the progress display
  • Loading branch information
devoncarew authored May 19, 2017
2 parents f737350 + 8655d7d commit 31c64f5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog

## unreleased

- Updated to the output for indeterminate progress

## 0.1.0

- Use the new `Platform.resolvedExecutable` API to locate the SDK
Expand Down
6 changes: 4 additions & 2 deletions lib/cli_logging.dart
Original file line number Diff line number Diff line change
Expand Up @@ -201,15 +201,17 @@ class _AnsiProgress extends Progress {
bool showTiming: false}) {
String char = kAnimationItems[_index % kAnimationItems.length];
if (isFinal || cancelled) {
char = ' ';
char = '';
}
io.stdout.write('${ansi.backspace}${char}');
if (isFinal || cancelled) {
if (message != null) {
io.stdout.write(message);
io.stdout.write(message.isEmpty ? ' ' : message);
} else if (showTiming) {
String time = (elapsed.inMilliseconds / 1000.0).toStringAsFixed(1);
io.stdout.write('${time}s');
} else {
io.stdout.write(' ');
}
io.stdout.writeln();
}
Expand Down

0 comments on commit 31c64f5

Please sign in to comment.