run method

  1. @override
Future<void> run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
Future<void> run() async {
  final currentVersion = await getVersionFromArgsOrPubspec();
  final args = ensureArgResults();
  final incrementBuild = !(args['freeze-build'] as bool);
  final theNextVersion = await getNextVersionFromString(
    await getCommits(),
    currentVersion,
    incrementBuild: incrementBuild,
    noBuild: args['no-build'] as bool,
    ensureMajor: args['ensure-major'] as bool,
  );
  printer.println(theNextVersion);
}