| Index: sdk/lib/_internal/pub/lib/src/io.dart
|
| diff --git a/sdk/lib/_internal/pub/lib/src/io.dart b/sdk/lib/_internal/pub/lib/src/io.dart
|
| index 0bd5c1420183bd13bae560a16622fe9c26185175..8d6196dd0bec9f1b086b1abe225ef0ed277f61e3 100644
|
| --- a/sdk/lib/_internal/pub/lib/src/io.dart
|
| +++ b/sdk/lib/_internal/pub/lib/src/io.dart
|
| @@ -422,6 +422,15 @@ Future drainStream(Stream stream) {
|
| return stream.fold(null, (x, y) {});
|
| }
|
|
|
| +/// Flushes the stdout and stderr streams, then exits the program with the given
|
| +/// status code.
|
| +///
|
| +/// This returns a Future that will never complete, since the program will have
|
| +/// exited already. This is useful to prevent Future chains from proceeding
|
| +/// after you've decided to exit.
|
| +Future flushThenExit(int status) =>
|
| + Future.wait([stdout.close(), stderr.close()]).then((_) => exit(status));
|
| +
|
| /// Returns a [EventSink] that pipes all data to [consumer] and a [Future] that
|
| /// will succeed when [EventSink] is closed or fail with any errors that occur
|
| /// while writing.
|
|
|