0
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-09-19 04:01:21 +02:00

fix(changelog): remove CR characters in breaking change messages

The GitHub UI might not remove CR characters from commit description forms
filled from a Windows browser.
This commit is contained in:
Marc Cornellà 2020-12-30 20:02:24 +01:00
parent a251233bec
commit a4a79eaa8c

View file

@ -91,6 +91,8 @@ function parse-commit {
if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \
"$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then
message="${match[1]}"
# remove CR characters (might be inserted in GitHub UI commit description form)
message="${message//$'\r'/}"
# skip next paragraphs (separated by two newlines or more)
message="${message%%$'\n\n'*}"
# ... and replace newlines with spaces