Skip to content

Commit 999a19f

Browse files
committed
chore: format CHANGELOG_DATA.json and update update_package_version.dart to format the updated CHANGELOG_DATA.json
1 parent f59e30c commit 999a19f

File tree

2 files changed

+552
-3
lines changed

2 files changed

+552
-3
lines changed

CHANGELOG_DATA.json

Lines changed: 545 additions & 1 deletion
Large diffs are not rendered by default.

scripts/update_package_version.dart

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ignore_for_file: avoid_print
22

3-
import 'dart:convert' show jsonDecode, jsonEncode;
3+
import 'dart:convert' show JsonEncoder, jsonDecode;
44
import 'dart:io' show File, exit;
55

66
// ignore: depend_on_referenced_packages
@@ -116,7 +116,12 @@ Future<void> _replaceVersion({
116116
..clear()
117117
..addAll(newMap);
118118
}
119-
await sourceChangeLogFile.writeAsString(jsonEncode(sourceChangeLog));
119+
120+
// Create a JsonEncoder with 4 spaces of indentation
121+
final spaces = ' ' * 4;
122+
final encoder = JsonEncoder.withIndent(spaces);
123+
124+
await sourceChangeLogFile.writeAsString(encoder.convert(sourceChangeLog));
120125
}
121126

122127
/// Update the [pubspecYamlPath] file to update the `version` property from [newVersion]

0 commit comments

Comments
 (0)