Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[puppy] actually rename command to run, sort directories, better logs #337

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oops! good catch


@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
Loading