Unverified Commit 961fdeeb authored by Pierre-Louis's avatar Pierre-Louis Committed by GitHub

[Fonts] Fix update_icons double newline bug (#78317)

parent db37499e
...@@ -36,7 +36,7 @@ const Map<String, List<String>> _platformAdaptiveIdentifiers = <String, List<Str ...@@ -36,7 +36,7 @@ const Map<String, List<String>> _platformAdaptiveIdentifiers = <String, List<Str
}; };
// Rewrite certain Flutter IDs (reserved keywords, numbers) using prefix matching. // Rewrite certain Flutter IDs (reserved keywords, numbers) using prefix matching.
const Map<String, String> _identifierRewrites = <String, String>{ const Map<String, String> identifierRewrites = <String, String>{
'1x': 'one_x', '1x': 'one_x',
'360': 'threesixty', '360': 'threesixty',
'2d': 'twod', '2d': 'twod',
...@@ -202,7 +202,7 @@ void main(List<String> args) { ...@@ -202,7 +202,7 @@ void main(List<String> args) {
final String newIconData = regenerateIconsFile(iconClassFileData, newTokenPairMap); final String newIconData = regenerateIconsFile(iconClassFileData, newTokenPairMap);
if (argResults[_dryRunOption] as bool) { if (argResults[_dryRunOption] as bool) {
stdout.writeln(newIconData); stdout.write(newIconData);
} else { } else {
stderr.writeln('\nWriting to ${iconClassFile.path}.'); stderr.writeln('\nWriting to ${iconClassFile.path}.');
iconClassFile.writeAsStringSync(newIconData); iconClassFile.writeAsStringSync(newIconData);
...@@ -348,9 +348,9 @@ class _Icon { ...@@ -348,9 +348,9 @@ class _Icon {
} }
flutterId = id; flutterId = id;
for (final MapEntry<String, String> rewritePair in _identifierRewrites.entries) { for (final MapEntry<String, String> rewritePair in identifierRewrites.entries) {
if (id.startsWith(rewritePair.key)) { if (id.startsWith(rewritePair.key)) {
flutterId = id.replaceFirst(rewritePair.key, _identifierRewrites[rewritePair.key]); flutterId = id.replaceFirst(rewritePair.key, identifierRewrites[rewritePair.key]);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment