validateInputs method

bool validateInputs(
  1. String? featureName,
  2. String appsName,
  3. String pathApps
)

Validates input parameters and project prerequisites.

Returns true if validation passes, false otherwise. Displays specific error messages with resolution guidance.

Implementation

bool validateInputs(String? featureName, String appsName, String pathApps) {
  if (featureName == null || featureName.isEmpty) {
    StatusHelper.failed(
        'Feature name is empty, add a new feature with "morpheme feature <feature-name>"');
    return false;
  }

  if (appsName.isNotEmpty && !exists(pathApps)) {
    StatusHelper.failed(
        'Apps with "$appsName" does not exists, create a new apps with "morpheme apps <apps-name>"');
    return false;
  }

  return true;
}