From 3be7f0aa3ec58c3332d47c4b78560ec29542a48a Mon Sep 17 00:00:00 2001 From: Clark Du Date: Thu, 14 Mar 2019 12:16:34 +0000 Subject: [PATCH] chore: improve commit shell [release] --- scripts/commits | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/scripts/commits b/scripts/commits index 7230d01288..e1957750c4 100755 --- a/scripts/commits +++ b/scripts/commits @@ -11,18 +11,22 @@ write() { echo "$@" >> commits.md } +writeSection() { + write + write "## $1" + write + res=`echo "$3" | awk "/^$2(.*):/;" | grep ":" | grep -v "renovate" | sed -e 's/^/- /' | sort` + write "$res" +} + write "Comaparing $latestTag...dev" diff=`git --no-pager log $latestTag...dev --pretty="%s (%an) (%h)"` -write -write "## Features" -write -res=`echo "$diff" | awk '/feat/' | grep ":" | grep -v "renovate" | sed -e 's/^/- /' | sort` -write "$res" - -write -write "## Fixes" -write -res=`echo "$diff" | awk '!/feat/' | grep ":" | grep -v "renovate" | sed -e 's/^/- /' | sort` -write "$res" +writeSection 'Features' 'feat' $diff +writeSection 'Fixes' 'fix' $diff +writeSection 'Refactors' 'refactor' $diff +writeSection 'Performance Improvements' 'perf' $diff +writeSection 'Examples' 'examples' $diff +writeSection 'Chore' 'chore' $diff +writeSection 'Tests' 'test' $diff