@@ -94,7 +94,9 @@ Future<void> genHeaderComments(
9494 String templateData;
9595 _print (Log .printWhite, 'Reading template at: $template ...' );
9696
97- final result = (await MdTemplateUtility .i.readTemplateFromPathOrUrl (template).value);
97+ final result = (await MdTemplateUtility .i
98+ .readTemplateFromPathOrUrl (template)
99+ .value);
98100
99101 if (result.isErr ()) {
100102 spinner.stop ();
@@ -125,9 +127,11 @@ Future<void> genHeaderComments(
125127// ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
126128
127129Future <void > _generateForFile (String filePath, String template) async {
128- final commentStarter = langFileCommentStarters[p.extension (filePath).toLowerCase ()] ?? '//' ;
130+ final commentStarter =
131+ langFileCommentStarters[p.extension (filePath).toLowerCase ()] ?? '//' ;
129132 var templateLines = template.split ('\n ' );
130- final sourceLines = (await FileSystemUtility .i.readLocalFileAsLinesOrNull (filePath)) ?? [];
133+ final sourceLines =
134+ (await FileSystemUtility .i.readLocalFileAsLinesOrNull (filePath)) ?? [];
131135 if (sourceLines.isNotEmpty) {
132136 // Replace leading '//' in all template lines with the comment starter
133137 templateLines = templateLines.map ((line) {
@@ -141,7 +145,8 @@ Future<void> _generateForFile(String filePath, String template) async {
141145 final line = sourceLines[n].trim ();
142146 if (line.isEmpty || ! line.startsWith (commentStarter)) {
143147 final withoutHeader = sourceLines.sublist (n).join ('\n ' );
144- final withHeader = '${templateLines .join ('\n ' )}\n\n ${withoutHeader .trimLeft ()}\n ' ;
148+ final withHeader =
149+ '${templateLines .join ('\n ' )}\n\n ${withoutHeader .trimLeft ()}\n ' ;
145150 await FileSystemUtility .i.writeLocalFile (filePath, withHeader);
146151 break ;
147152 }
0 commit comments