excecute method
Future<void>
excecute(
)
override
Implementation
@override
Future<void> excecute() async {
final arch = findCurrentArchitecture();
if (arch == null) {
redLog(
"[ERROR] project is not initialized or 'easy_init_...' file is missing from root folder");
} else {
if (name != '') {
featureName = name;
} else {
featureName = UserInput.askQuestion("Feature name", "home");
}
var isExist = await isFeatureExist(featureName.snakeCase, arch);
if (isExist == true) {
redLog(
"[ERROR] Feature with name '$featureName' already exist, retry with different name");
} else if (isExist == false) {
if (arch == 'tdd-brf') {
_createFeature(
structure: TddCleanStructure(), featureName: featureName);
} else if (arch == "mvc-grl") {
_createFeature(
structure: MvcGetXStructure(), featureName: featureName);
}
} else {
redLog("[ERROR] feature creation failed");
}
}
}