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

Unified Diff: sdk/lib/_internal/pub/lib/src/command/global_run.dart

Issue 514853003: Hook async/await compiler into pub and use it. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 6 years, 4 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
Index: sdk/lib/_internal/pub/lib/src/command/global_run.dart
diff --git a/sdk/lib/_internal/pub/lib/src/command/global_run.dart b/sdk/lib/_internal/pub/lib/src/command/global_run.dart
index d0f35ba70af58aaaf3b117f71c3343d1fc34ecc5..a99c06958d5be42e81ac3e54c6cb87989c8fa6bd 100644
--- a/sdk/lib/_internal/pub/lib/src/command/global_run.dart
+++ b/sdk/lib/_internal/pub/lib/src/command/global_run.dart
@@ -20,7 +20,7 @@ class GlobalRunCommand extends PubCommand {
"NOTE: We are currently optimizing this command's startup time.";
String get usage => "pub global run <package>:<executable> [args...]";
- Future onRun() {
+ Future onRun() async {
if (commandOptions.rest.isEmpty) {
usageError("Must specify an executable to run.");
}
@@ -38,9 +38,9 @@ class GlobalRunCommand extends PubCommand {
var args = commandOptions.rest.skip(1).toList();
- return globals.find(package).then((entrypoint) {
- return runExecutable(this, entrypoint, package, executable, args,
- isGlobal: true);
- }).then(flushThenExit);
+ var entrypoint = await globals.find(package);
+ var exitCode = await runExecutable(this, entrypoint, package, executable,
+ args, isGlobal: true);
+ return flushThenExit(exitCode);
nweiz 2014/08/27 20:10:07 Nit: I like using "await" rather than "return" her
Bob Nystrom 2014/08/27 21:35:32 Done.
}
}

Powered by Google App Engine
This is Rietveld 408576698