discoverCustomCommands static method
Discovers the project's commands.json commands plus package commands (see
discoverPackageCommands). Precedence: reservedCommands, project, packages.
Implementation
static Future<List<NyCommand>> discoverCustomCommands({
Directory? projectDirectory,
Iterable<String> reservedCommands = const [],
void Function(String message)? onWarning,
}) async {
final void Function(String message) warn =
onWarning ?? MetroConsole.writeInYellow;
final List<NyCommand> projectCommands = await _discoverProjectCommands(
projectDirectory,
);
final List<NyCommand> packageCommands = await discoverPackageCommands(
projectDirectory: projectDirectory,
onWarning: warn,
);
return mergeCommands(
projectCommands: projectCommands,
packageCommands: packageCommands,
reservedCommands: reservedCommands,
onWarning: warn,
);
}