Add --bug-report flag (#8435)

This adds support for a `--bug-report` flag, which is a recording
that:
  - includes the arguments that were passed to the command runner
  - is zipped up for easy attachment in Guthub issues
This commit is contained in:
Todd Volkert
2017-02-27 15:38:47 -08:00
committed by GitHub
parent 97083ac6aa
commit f60410fa9d
12 changed files with 227 additions and 40 deletions

View File

@@ -126,7 +126,7 @@ Future<Null> main(List<String> args) async {
return Chain.capture<Future<Null>>(() async {
await runner.run(args);
_exit(0);
await _exit(0);
}, onError: (dynamic error, Chain chain) {
if (error is UsageException) {
stderr.writeln(error.message);
@@ -249,9 +249,14 @@ Future<Null> _exit(int code) async {
// Run shutdown hooks before flushing logs
await runShutdownHooks();
Completer<Null> completer = new Completer<Null>();
// Give the task / timer queue one cycle through before we hard exit.
Timer.run(() {
printTrace('exiting with code $code');
exit(code);
completer.complete();
});
await completer.future;
}