@@ -40,10 +40,9 @@ void main(List<String> args) {
40
40
),
41
41
);
42
42
}
43
- contents =
44
- '# Changelog\n\n ${(sections .toList ()..sort ((a , b ) {
45
- return compareVersions (b .version , a .version );
46
- })).map ((e ) => e .toString ()).join ('\n ' )}' ;
43
+ contents = '# Changelog\n\n ${(sections .toList ()..sort ((a , b ) {
44
+ return compareVersions (b .version , a .version );
45
+ })).map ((e ) => e .toString ()).join ('\n ' )}' ;
47
46
48
47
file.writeAsStringSync (contents);
49
48
print ('Changelog updated with version $version .' );
@@ -60,9 +59,8 @@ Set<_VersionSection> extractSections(String contents) {
60
59
final end = i + 1 < allVersionMatches.length ? allVersionMatches[i + 1 ].start : contents.length;
61
60
final sectionContents = contents.substring (start, end).trim ();
62
61
final lines = sectionContents.split ('\n ' ).where ((line) => line.isNotEmpty).toList ();
63
- final version = allVersionMatches[i]
64
- .group (0 )!
65
- .substring (4 , allVersionMatches[i].group (0 )! .length - 1 );
62
+ final version =
63
+ allVersionMatches[i].group (0 )! .substring (4 , allVersionMatches[i].group (0 )! .length - 1 );
66
64
var releasedAt = DateTime .now ().toUtc ();
67
65
final updates = < String > {};
68
66
final old = lines
@@ -78,7 +76,11 @@ Set<_VersionSection> extractSections(String contents) {
78
76
updates.add (line);
79
77
}
80
78
}
81
- results.add (_VersionSection (version: version, releasedAt: releasedAt, updates: updates));
79
+ results.add (_VersionSection (
80
+ version: version,
81
+ releasedAt: releasedAt,
82
+ updates: updates,
83
+ ));
82
84
}
83
85
84
86
return results;
@@ -99,8 +101,11 @@ class _VersionSection {
99
101
//
100
102
//
101
103
102
- _VersionSection ({required this .version, required this .releasedAt, Set <String >? updates})
103
- : this .updates = updates ?? {};
104
+ _VersionSection ({
105
+ required this .version,
106
+ required this .releasedAt,
107
+ Set <String >? updates,
108
+ }) : this .updates = updates ?? {};
104
109
105
110
//
106
111
//
0 commit comments