mirror of
https://github.com/flutter/packages.git
synced 2025-08-06 17:28:42 +08:00
[tool] Add command aliases (#4207)
Adds aliases for all commands that put the verb first, since currently they are inconsistent which can make it hard to remember (in particular, I often write `check-foo` instead of `foo-check` when running locally, and it fails). Also does the long-overdue renaming of `test` to `dart-test`, since we now have `native-test`, `custom-test`, etc. `test` continues to work as an alias for individual muscle memory.
This commit is contained in:
@ -89,6 +89,9 @@ class PubspecCheckCommand extends PackageLoopingCommand {
|
||||
@override
|
||||
final String name = 'pubspec-check';
|
||||
|
||||
@override
|
||||
List<String> get aliases => <String>['check-pubspec'];
|
||||
|
||||
@override
|
||||
final String description =
|
||||
'Checks that pubspecs follow repository conventions.';
|
||||
@ -104,8 +107,8 @@ class PubspecCheckCommand extends PackageLoopingCommand {
|
||||
Future<void> initializeRun() async {
|
||||
// Find all local, published packages.
|
||||
for (final File pubspecFile in (await packagesDir.parent
|
||||
.list(recursive: true, followLinks: false)
|
||||
.toList())
|
||||
.list(recursive: true, followLinks: false)
|
||||
.toList())
|
||||
.whereType<File>()
|
||||
.where((File entity) => p.basename(entity.path) == 'pubspec.yaml')) {
|
||||
final Pubspec? pubspec = _tryParsePubspec(pubspecFile.readAsStringSync());
|
||||
|
Reference in New Issue
Block a user