Open
Description
Describe the bug
2 warnings:
- When running
commit-and-tag-version
on Windows (and having default git configuration), file is generated with LF instead of CRLF. - According to
markdownlint
, generatedCHANGELOG.md
has an extra (unnecessary) break line. One line before each commit type header is enough. No need to put 2.
Current behavior
npx commit-and-tag-version --first-release
× skip version bump on first release
√ outputting changes to CHANGELOG.md
√ committing CHANGELOG.md
warning: in the working copy of 'CHANGELOG.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'CHANGELOG.md', LF will be replaced by CRLF the next time Git touches it
warning: in the working copy of 'CHANGELOG.md', LF will be replaced by CRLF the next time Git touches it
...
Expected behavior
No warnings
Environment
commit-and-tag-version
version(s): v12.5.0- Node/npm version: Node 20.17.0/npm 10.8.2
- OS: Windows 11
Possible Solution
-
Read git configuration (
git config --get core.autocrlf
) and generate the file accordingly- if OS == Windows and core.autocrlf is true, then CRLF, else LF
- Or just use
os.EOL
from os module (https://stackoverflow.com/a/16829025/767160)
-
Remove the extra line from generated file
Additional context