middleware function
Implementation
FutureOr middleware(List<String> args) async {
List<String> names = args.sublist(1);
if (names.isEmpty) {
return;
}
String directory = absolute('lib/middleware');
Directory dir = Directory(directory);
if (!dir.existsSync()) {
dir.createSync();
}
RegExp alpha = RegExp(r'^[a-zA-Z]+$');
for (String name in names) {
if (alpha.hasMatch(name)) {
_createMiddleware(name, directory);
}
}
}