Skip to content

Commit 4b840c7

Browse files
authored
fix: Avoid duplicated "Change Log" file header on Windows due to CRLF (closes #710) (#915)
Closes #710 ## Type of Change <!--- Put an `x` in all the boxes that apply: --> - [ ] ✨ `feat` -- New feature (non-breaking change which adds functionality) - [x] 🛠️ `fix` -- Bug fix (non-breaking change which fixes an issue) - [ ] ❌ `!` -- Breaking change (fix or feature that would cause existing functionality to change) - [ ] 🧹 `refactor` -- Code refactor - [ ] ✅ `ci` -- Build configuration change - [ ] 📝 `docs` -- Documentation - [ ] 🗑️ `chore` -- Chore
1 parent a7cb57b commit 4b840c7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/melos/lib/src/common/aggregate_changelog.dart

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,9 @@ ${description?.withoutTrailing('\n') ?? ''}
157157
Future<String> read() async {
158158
if (fileExists(absolutePath)) {
159159
final contents = await readTextFileAsync(absolutePath);
160-
return contents.replaceFirst(_changelogFileHeader, '');
160+
return contents
161+
.replaceAll('\r\n', '\n')
162+
.replaceFirst(_changelogFileHeader, '');
161163
}
162164
return '';
163165
}

0 commit comments

Comments
 (0)