OLD | NEW |
1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library pub.command.run; | 5 library pub.command.run; |
6 | 6 |
7 import 'dart:async'; | 7 import 'dart:async'; |
8 | 8 |
9 import 'package:barback/barback.dart'; | 9 import 'package:barback/barback.dart'; |
10 import 'package:path/path.dart' as p; | 10 import 'package:path/path.dart' as p; |
11 | 11 |
12 import '../command.dart'; | 12 import '../command.dart'; |
13 import '../executable.dart'; | 13 import '../executable.dart'; |
14 import '../io.dart'; | 14 import '../io.dart'; |
15 import '../log.dart' as log; | |
16 import '../utils.dart'; | 15 import '../utils.dart'; |
17 | 16 |
18 /// Handles the `run` pub command. | 17 /// Handles the `run` pub command. |
19 class RunCommand extends PubCommand { | 18 class RunCommand extends PubCommand { |
20 String get name => "run"; | 19 String get name => "run"; |
21 String get description => "Run an executable from a package.\n" | 20 String get description => "Run an executable from a package."; |
22 "NOTE: We are currently optimizing this command's startup time."; | |
23 String get invocation => "pub run <executable> [args...]"; | 21 String get invocation => "pub run <executable> [args...]"; |
24 bool get allowTrailingOptions => false; | 22 bool get allowTrailingOptions => false; |
25 | 23 |
26 RunCommand() { | 24 RunCommand() { |
27 argParser.addOption("mode", | 25 argParser.addOption("mode", |
28 help: 'Mode to run transformers in.\n' | 26 help: 'Mode to run transformers in.\n' |
29 '(defaults to "release" for dependencies, "debug" for ' | 27 '(defaults to "release" for dependencies, "debug" for ' |
30 'entrypoint)'); | 28 'entrypoint)'); |
31 } | 29 } |
32 | 30 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 mode = BarbackMode.DEBUG; | 63 mode = BarbackMode.DEBUG; |
66 } else { | 64 } else { |
67 mode = BarbackMode.RELEASE; | 65 mode = BarbackMode.RELEASE; |
68 } | 66 } |
69 | 67 |
70 var exitCode = await runExecutable(entrypoint, package, executable, args, | 68 var exitCode = await runExecutable(entrypoint, package, executable, args, |
71 mode: mode); | 69 mode: mode); |
72 await flushThenExit(exitCode); | 70 await flushThenExit(exitCode); |
73 } | 71 } |
74 } | 72 } |
OLD | NEW |