mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-12 20:21:02 +01:00
fix(changelog): allow breaking change message to span multiple lines
This also allows the option to put extra paragraphs after the BREAKING CHANGE message while properly displaying the breaking change message. Useful, for example, to add signed-off or co-authored lines.
This commit is contained in:
parent
e8e37eedbc
commit
e2c73cf59a
1 changed files with 6 additions and 2 deletions
|
@ -86,11 +86,15 @@ function parse-commit {
|
||||||
|
|
||||||
# Return subject if the body or subject match the breaking change format
|
# Return subject if the body or subject match the breaking change format
|
||||||
function commit:is-breaking {
|
function commit:is-breaking {
|
||||||
local subject="$1" body="$2"
|
local subject="$1" body="$2" message
|
||||||
|
|
||||||
if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \
|
if [[ "$body" =~ "BREAKING CHANGE: (.*)" || \
|
||||||
"$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then
|
"$subject" =~ '^[^ :\)]+\)?!: (.*)$' ]]; then
|
||||||
echo "${match[1]}"
|
message="${match[1]}"
|
||||||
|
# skip next paragraphs (separated by two newlines or more)
|
||||||
|
message="${message%%$'\n\n'*}"
|
||||||
|
# ... and replace newlines with spaces
|
||||||
|
echo "${message//$'\n'/ }"
|
||||||
else
|
else
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
Loading…
Reference in a new issue