Remove TODO and comments with regard to running packages in the `dart run *` command
If/ when we decide to support it, we can modify the description and implement it
Change-Id: Ia222227017397aa817ac55c4dfed6e4647c05556
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/141854
Commit-Queue: Jonas Jensen <jonasfj@google.com>
Auto-Submit: Jaime Wren <jwren@google.com>
Reviewed-by: Jonas Jensen <jonasfj@google.com>
diff --git a/pkg/dartdev/lib/src/commands/run.dart b/pkg/dartdev/lib/src/commands/run.dart
index b4e202e..c7089b1 100644
--- a/pkg/dartdev/lib/src/commands/run.dart
+++ b/pkg/dartdev/lib/src/commands/run.dart
@@ -14,10 +14,7 @@
final ArgParser argParser = ArgParser.allowAnything();
RunCommand({bool verbose = false}) : super('run', '''
-Run a Dart app or package.
-
-dart run <file path> run the specified Dart file
-dart run package:foo run the Dart file specified by some <package>:<executable>''');
+Run a Dart file.''');
@override
String get invocation => '${super.invocation} <dart file | package target>';
@@ -37,8 +34,12 @@
// and we want to guarantee that the result (the help text for the console)
// is printed before command exits.
final result = Process.runSync(command, args);
- stderr.write(result.stderr);
- stdout.write(result.stdout);
+ if (result.stderr.isNotEmpty) {
+ stderr.write(result.stderr);
+ }
+ if (result.stdout.isNotEmpty) {
+ stdout.write(result.stdout);
+ }
}
@override
@@ -46,9 +47,6 @@
// the command line arguments after 'run'
final args = argResults.arguments;
- // TODO(jwren) Implement support for pubspec executables, see
- // https://dart.dev/tools/pub/pubspec#executables
-
// Starting in ProcessStartMode.inheritStdio mode means the child process
// can detect support for ansi chars.
var process = await Process.start(sdk.dart, args,