Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(495)

Unified Diff: utils/pub/io.dart

Issue 11169003: Extract a list of lines from a process' stdout and stderr, in pub. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/pub/io.dart
diff --git a/utils/pub/io.dart b/utils/pub/io.dart
index 805227bac6c50bac157d9b3ec4c1551d90559eef..384cc08b8a3994f16f0f83eeda8def56670a4dc8 100644
--- a/utils/pub/io.dart
+++ b/utils/pub/io.dart
@@ -501,7 +501,15 @@ Future<PubProcessResult> runProcess(String executable, List<String> args,
var future = Process.run(executable, args, options);
return future.transform((result) {
- return new PubProcessResult(result.stdout, result.stderr, result.exitCode);
+ // TODO(rnystrom): Remove this and change to returning one string.
+ List<String> toLines(String output) {
+ var lines = output.split("\n");
+ if (!lines.isEmpty() && lines.last() == "") lines.removeLast();
+ return lines;
+ }
+ return new PubProcessResult(toLines(result.stdout),
+ toLines(result.stderr),
+ result.exitCode);
});
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698