Skip to content

Commit

Permalink
Tweak command.
Browse files Browse the repository at this point in the history
  • Loading branch information
matanlurey committed Oct 19, 2024
1 parent 2773fc7 commit 98602d9
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
16 changes: 15 additions & 1 deletion dev/bin/dev.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,21 @@ void main(List<String> args) async {

final earlyArgs = ArgParser();
Context.registerArgs(earlyArgs, packages: available);
final argResults = earlyArgs.parse(args);

// Find the first command.
var end = args.length;
for (var i = 0; i < args.length; i++) {
if (const {
'generate',
'check',
'coverage',
'test',
}.contains(args[i])) {
end = i;
break;
}
}
final argResults = earlyArgs.parse(args.getRange(0, end));

await Runner(
await Context.resolve(
Expand Down
4 changes: 3 additions & 1 deletion packages/chore/lib/src/command/check.dart
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ final class Check extends BaseCommand {
Check(super.context, super.environment) {
argParser.addFlag(
'fix',
help: 'Automaticallyfix issues when possible.',
help: 'Automatically fix issues when possible.',
);
}

Expand Down Expand Up @@ -57,6 +57,8 @@ final class Check extends BaseCommand {
if ((await process.exitCode).isFailure) {
io.exitCode = 1;
io.stderr.writeln('❌ Found formatting issues.');
} else if (fix) {
io.stderr.writeln('✅ Ran formatter.');
} else {
io.stderr.writeln('✅ No formatting issues found.');
}
Expand Down

0 comments on commit 98602d9

Please sign in to comment.