diff --git a/pkgs/puppy/lib/src/run_command.dart b/pkgs/puppy/lib/src/run_command.dart index 09352779..1bb7a6b7 100644 --- a/pkgs/puppy/lib/src/run_command.dart +++ b/pkgs/puppy/lib/src/run_command.dart @@ -8,6 +8,7 @@ import 'dart:io'; import 'package:args/command_runner.dart'; import 'package:build_cli_annotations/build_cli_annotations.dart'; import 'package:io/ansi.dart'; +import 'package:path/path.dart' as p; import 'constants.dart'; import 'utils.dart'; @@ -21,7 +22,7 @@ class RunCommand extends _$RunArgsCommand { '`pubspec.yaml`.'; @override - String get name => 'map'; + String get name => 'run'; @override Future? run() async { @@ -33,8 +34,13 @@ class RunCommand extends _$RunArgsCommand { final packages = findPackages(Directory.current, deep: args.deep); final exits = {}; + var count = 0; for (final packageDir in packages) { - print(green.wrap(packageDir.path)); + final relative = p.relative(packageDir.path); + + print( + green.wrap('$relative (${++count} of ${packages.length})'), + ); final proc = await Process.start( exe, extraArgs, diff --git a/pkgs/puppy/lib/src/utils.dart b/pkgs/puppy/lib/src/utils.dart index d9601352..88dfd49c 100644 --- a/pkgs/puppy/lib/src/utils.dart +++ b/pkgs/puppy/lib/src/utils.dart @@ -29,5 +29,7 @@ List findPackages(Directory root, {bool deep = false}) { traverse(Directory.current, deep: deep); + results.sort((a, b) => a.path.compareTo(b.path)); + return results; } diff --git a/pkgs/puppy/pubspec.yaml b/pkgs/puppy/pubspec.yaml index 9f649ad4..d27f46a4 100644 --- a/pkgs/puppy/pubspec.yaml +++ b/pkgs/puppy/pubspec.yaml @@ -9,6 +9,7 @@ dependencies: args: ^2.6.0 build_cli_annotations: ^2.1.0 io: ^1.0.5 + path: ^1.9.1 dev_dependencies: build_cli: ^2.2.4