Skip to content

Commit 94b4cea

Browse files
authored
[puppy] actually rename command to run, sort directories, better logs (#337)
1 parent f2d3178 commit 94b4cea

File tree

3 files changed

+11
-2
lines changed

3 files changed

+11
-2
lines changed

pkgs/puppy/lib/src/run_command.dart

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import 'dart:io';
88
import 'package:args/command_runner.dart';
99
import 'package:build_cli_annotations/build_cli_annotations.dart';
1010
import 'package:io/ansi.dart';
11+
import 'package:path/path.dart' as p;
1112

1213
import 'constants.dart';
1314
import 'utils.dart';
@@ -21,7 +22,7 @@ class RunCommand extends _$RunArgsCommand<void> {
2122
'`pubspec.yaml`.';
2223

2324
@override
24-
String get name => 'map';
25+
String get name => 'run';
2526

2627
@override
2728
Future<void>? run() async {
@@ -33,8 +34,13 @@ class RunCommand extends _$RunArgsCommand<void> {
3334
final packages = findPackages(Directory.current, deep: args.deep);
3435
final exits = <String, int>{};
3536

37+
var count = 0;
3638
for (final packageDir in packages) {
37-
print(green.wrap(packageDir.path));
39+
final relative = p.relative(packageDir.path);
40+
41+
print(
42+
green.wrap('$relative (${++count} of ${packages.length})'),
43+
);
3844
final proc = await Process.start(
3945
exe,
4046
extraArgs,

pkgs/puppy/lib/src/utils.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,5 +29,7 @@ List<Directory> findPackages(Directory root, {bool deep = false}) {
2929

3030
traverse(Directory.current, deep: deep);
3131

32+
results.sort((a, b) => a.path.compareTo(b.path));
33+
3234
return results;
3335
}

pkgs/puppy/pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dependencies:
99
args: ^2.6.0
1010
build_cli_annotations: ^2.1.0
1111
io: ^1.0.5
12+
path: ^1.9.1
1213

1314
dev_dependencies:
1415
build_cli: ^2.2.4

0 commit comments

Comments
 (0)