boostNumber static method

void boostNumber()

Implementation

static void boostNumber() async {
  final boostPattern = RegExp(
      r'((version:.)(\d*)\.(\d*)\.(\d*)\+?(\-(beta)?(alpha)?(dev)?\.)?)(\d*)');
  String pubspec = "";
  await File('pubspec.yaml').readAsString().then((String contents) {
    pubspec = contents;
  });
  pubspec = pubspec.replaceAllMapped(
      boostPattern,
      (match) => match[10]!.isEmpty
          ? '${match[1]}+1'
          : '${match[1]}${int.parse(match[10]!).plus()}');
  // print(pubspec);
  createFile('pubspec.yaml', pubspec);
}