sync method

Future<int> sync()

Brings the baseline up to date and applies every patch. Run after pub changes the resolved packages.

Throws a DpkException when a patch is stale or conflicts with edits.

Implementation

Future<int> sync() async {
  if (!exists) {
    return 0;
  }
  await updateBaseline();
  final applied = await apply();
  if (applied > 0) {
    console.step('> Applied $applied patch${applied == 1 ? '' : 'es'}.');
  }
  return 0;
}