The original implementation did not handle https URLs. If one cloned a repository via https://github.com/my/project.git the URL in CHANGELOG.md still contained the .git suffix. This is only a issue if a new CHANGELOG.md file is created by --init, otherwise the correct URL is taken from existing tag / compare entries.
Also the remoteUrls protocol does not need to be set by hand, since new URL() seems to parse the correct protocol from the URL.
I think it would be a good idea to move normalizeUrl into the library code and add some unit tests, but I am not sure if you want this since this is only used in bin.ts
The original implementation did not handle https URLs. If one cloned a repository via https://github.com/my/project.git the URL in
CHANGELOG.md
still contained the .git suffix. This is only a issue if a newCHANGELOG.md
file is created by--init
, otherwise the correct URL is taken from existing tag / compare entries.Also the remoteUrls protocol does not need to be set by hand, since new URL() seems to parse the correct protocol from the URL.
I tested the implementation with these inputs:
I think it would be a good idea to move
normalizeUrl
into the library code and add some unit tests, but I am not sure if you want this since this is only used inbin.ts