validateForPatching static method

String? validateForPatching({
  1. required String appDir,
  2. required File entry,
  3. required bool usesApplicationEntry,
  4. required ExecutionMode mode,
  5. required String configuredPath,
  6. required String activePath,
})

Validates all source paths before the patcher starts its file transaction.

Keeping this preflight as one operation ensures every caller applies the same root-boundary checks before reading an entry or mutating the pubspec.

Implementation

static String? validateForPatching({
  required String appDir,
  required File entry,
  required bool usesApplicationEntry,
  required ExecutionMode mode,
  required String configuredPath,
  required String activePath,
}) {
  validatePathWithinRoot(root: appDir, relativePath: 'pubspec.yaml');
  validatePathWithinRoot(root: appDir, relativePath: configuredPath);
  return validate(
    entry: entry,
    usesApplicationEntry: usesApplicationEntry,
    mode: mode,
    configuredPath: configuredPath,
    activePath: activePath,
  );
}