getNextVersionFromString method

Future<String> getNextVersionFromString(
  1. List<Commit> commits,
  2. String currentVersion, {
  3. bool incrementBuild = false,
  4. bool noBuild = false,
  5. bool ensureMajor = false,
})

Implementation

Future<String> getNextVersionFromString(
  List<Commit> commits,
  String currentVersion, {
  bool incrementBuild = false,
  bool noBuild = false,
  bool ensureMajor = false,
}) async {
  final previousVersion = Version.parse(currentVersion);
  final newVersion = nextVersion(
    previousVersion,
    commits,
    incrementBuild: incrementBuild,
    afterV1: ensureMajor,
  );
  return (noBuild ? versionWithoutBuild(newVersion) : newVersion).toString();
}