INNER CODE UNIT · Dart
_latestAnalysisVersionRegExp
VeryGoodOpenSource/very_good_analysis · tool/bump_version/lib/bump_version.dart:30
final _latestAnalysisVersionRegExp = RegExp(
r'analysis_options\.(\d+\.\d+\.\d+)\.yaml',
);
void main(List<String> args) => bumpVersion(args[0]);
/// Bumps the version of the analysis options file and the pubspec.yaml file.
void bumpVersion(String newVersion, {String basePath = ''}) {
final analysisOptionsFile = File('${basePath}lib/analysis_options.yaml');
final content = analysisOptionsFile.readAsStringSync();
final latestVersion = _latestAnalysisVersionRegExp
.firstMatch(content)
?.group(1);
final latestAnalysisOptionsFile = File(
'${basePath}lib/analysis_options.$latestVersion.yaml',
);