checkProjectPrerequisites method

void checkProjectPrerequisites()

Fails early when files the pipeline depends on are absent, pointing at the command that creates them instead of failing mid-build.

Implementation

void checkProjectPrerequisites() {
  final pubspec = File(p.join(projectDir, 'pubspec.yaml'));
  if (!pubspec.existsSync()) {
    throw BuildException(
      'pubspec.yaml not found at "$projectDir".',
      fix: 'Run this command from the root of your Flutter project.',
    );
  }

  final icons = File(p.join(projectDir, 'flutter_launcher_icons.yaml'));
  if (!icons.existsSync()) {
    throw BuildException(
      'flutter_launcher_icons.yaml not found at project root.',
      fix: 'Run "udara_cli setup" to generate it, then '
          '"udara_cli doctor" to verify the project.',
    );
  }
}