Skip to content

Commit

Permalink
Update run_command.dart
Browse files Browse the repository at this point in the history
  • Loading branch information
devoncarew authored Jan 11, 2025
1 parent b601c31 commit f199499
Showing 1 changed file with 22 additions and 24 deletions.
46 changes: 22 additions & 24 deletions pkgs/puppy/lib/src/run_command.dart
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,28 @@ class RunCommand extends _$RunArgsCommand<void> {

@override
Future<void>? 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 = <String, int>{};

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('');
}
}
}

Expand All @@ -48,26 +69,3 @@ class RunArgs {
}
}
}

Future<void> _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 = <String, int>{};

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('');
}
}

0 comments on commit f199499

Please sign in to comment.