doRun method

void doRun({
  1. required bool dryrun,
  2. required void runRelease(),
})

Runs the release process. If we are running a dry run we back up key files that we have to change for the pub.dev publish dry run to work but which we don't actually want to changes as we are doing a dry run. At the end of the dry run we restore these key files.

Implementation

void doRun({required bool dryrun, required void Function() runRelease}) {
  if (dryrun) {
    withFileProtection([
      join(pathToPackageRoot, 'pubspec.yaml'),
      changeLogPath,
      versionLibraryPath(pathToPackageRoot),
    ], () {
      runRelease();
    });
  } else {
    runRelease();
  }
}