check method

Future<void> check()

Implementation

Future<void> check() async {
  if (!directory.existsSync()) {
    throw CliException('Directory not exists: $directoryPath');
  }

  if (!pubspecFile.existsSync()) {
    throw CliException("'pubspec.yaml' not found in $directoryPath");
  }

  if (!isWithin(directoryPath, targetPath)) {
    throw CliException('Target path must be within package directory');
  }

  if (!targetFile.existsSync()) {
    throw CliException('Target file not found: $targetPath');
  }
}