forked from extern/ohmyzsh
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:
parent
a251233bec
commit
a4a79eaa8c
@ -91,6 +91,8 @@ function parse-commit {
|
|||||||
if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \
|
if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \
|
||||||
"$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then
|
"$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then
|
||||||
message="${match[1]}"
|
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)
|
# skip next paragraphs (separated by two newlines or more)
|
||||||
message="${message%%$'\n\n'*}"
|
message="${message%%$'\n\n'*}"
|
||||||
# ... and replace newlines with spaces
|
# ... and replace newlines with spaces
|
||||||
|
Loading…
Reference in New Issue
Block a user