Nuxt/scripts/commits
2019-03-14 12:16:34 +00:00

33 lines
720 B
Bash
Executable File

#!/bin/bash
# https://git-scm.com/docs/pretty-formats
latestTag=`git describe | grep -oE "^[^-]+"`
rm commits.md
write() {
echo "$@"
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)"`
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