Skip to content

Commit

Permalink
[puppy] actually rename command to run, sort directories, better lo…
Browse files Browse the repository at this point in the history
…gs (#337)
  • Loading branch information
kevmoo authored Jan 14, 2025
1 parent f2d3178 commit 94b4cea
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkgs/puppy/lib/src/run_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -21,7 +22,7 @@ class RunCommand extends _$RunArgsCommand<void> {
'`pubspec.yaml`.';

@override
String get name => 'map';
String get name => 'run';

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

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,
Expand Down
2 changes: 2 additions & 0 deletions pkgs/puppy/lib/src/utils.dart
Original file line number Diff line number Diff line change
Expand Up @@ -29,5 +29,7 @@ List<Directory> findPackages(Directory root, {bool deep = false}) {

traverse(Directory.current, deep: deep);

results.sort((a, b) => a.path.compareTo(b.path));

return results;
}
1 change: 1 addition & 0 deletions pkgs/puppy/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 94b4cea

Please sign in to comment.