diff --git a/pkgs/puppy/lib/src/run_command.dart b/pkgs/puppy/lib/src/run_command.dart index d6fcb50d..09352779 100644 --- a/pkgs/puppy/lib/src/run_command.dart +++ b/pkgs/puppy/lib/src/run_command.dart @@ -25,7 +25,28 @@ class RunCommand extends _$RunArgsCommand { @override Future? run() async { - await _doMap(_options); + final args = _options; + + final exe = args.rest.first; + final extraArgs = args.rest.skip(1).toList(); + + final packages = findPackages(Directory.current, deep: args.deep); + final exits = {}; + + for (final packageDir in packages) { + print(green.wrap(packageDir.path)); + final proc = await Process.start( + exe, + extraArgs, + mode: ProcessStartMode.inheritStdio, + workingDirectory: packageDir.path, + ); + + // TODO(kevmoo): display a summary of results on completion + exits[packageDir.path] = await proc.exitCode; + + print(''); + } } } @@ -48,26 +69,3 @@ class RunArgs { } } } - -Future _doMap(RunArgs args) async { - final exe = args.rest.first; - final extraArgs = args.rest.skip(1).toList(); - - final packages = findPackages(Directory.current, deep: args.deep); - final exits = {}; - - for (final packageDir in packages) { - print(green.wrap(packageDir.path)); - final proc = await Process.start( - exe, - extraArgs, - mode: ProcessStartMode.inheritStdio, - workingDirectory: packageDir.path, - ); - - // TODO(kevmoo): display a summary of results on completion - exits[packageDir.path] = await proc.exitCode; - - print(''); - } -}