Skip to content

Commit 58e69af

Browse files
committed
fix(template.sh): fix space issue
An additional number of new lines may be printed when the final result is printed.
1 parent 4f556f0 commit 58e69af

File tree

1 file changed

+15
-5
lines changed

1 file changed

+15
-5
lines changed

template.sh

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,15 +101,25 @@ if [ ! -z "$scope" ]; then
101101
scope="(${scope})"
102102
fi
103103

104+
massage="\n ${GREEN}${type_var}${scope}: ${short_desc}\n"
105+
106+
if [ ! -z "$long_desc" ] || [ ! -z "$breaking_changes" ] || [ ! -z "$closed_issues" ]; then
107+
massage="${massage}\n"
108+
fi
109+
110+
if [ ! -z "$long_desc" ]; then
111+
massage="${massage} ${long_desc}\n"
112+
fi
113+
104114
if [ ! -z "$breaking_changes" ]; then
105-
breaking_changes="BREAKING CHANGE: ${breaking_changes}"
115+
massage="${massage} BREAKING CHANGE: ${breaking_changes}\n"
106116
fi
107117

108-
printf "\n ${GREEN}${type_var}${scope}: ${short_desc}
118+
if [ ! -z "$closed_issues" ]; then
119+
massage="${massage} ${closed_issues}\n"
120+
fi
109121

110-
${long_desc}
111-
${breaking_changes}
112-
${closed_issues}${RESET}\n\n"
122+
printf "${massage}\n${RESET}"
113123

114124
# Git commit
115125
result_code=$?

0 commit comments

Comments
 (0)