Skip to content

Commit e63bcc0

Browse files
author
github-actions
committed
Prepare version 0.4.3
1 parent 54aa29d commit e63bcc0

File tree

2 files changed

+14
-4
lines changed

2 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## [0.4.3]
4+
5+
- Released @ 6/2025 (UTC)
6+
- chore: Update dependencies
7+
38
## [0.4.2]
49

510
- Released @ 2/2025 (UTC)

lib/src/gen_header_coments.dart

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -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

127129
Future<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

Comments
 (0)