checkIfDirectoryExists method
Future<void>
checkIfDirectoryExists(
{ - required String layer,
- required dynamic call(
- String path
),
})
Implementation
Future<void> checkIfDirectoryExists({
required String layer,
required Function(String path) call,
}) async {
final dialog = CLI_Dialog(
booleanQuestions: [
[
'Do you would like create $layer layer?',
'create_directory',
],
],
);
final result = dialog.ask();
if (!result['create_directory']) {
return;
}
final path = (anwers['path'] as String).split('/');
path.removeLast();
await generateLayerController.generateLayerFolders(
layerCommand: layer,
path: path.first,
);
call(path.join('/'));
}