Nuxt/scripts/commits
2019-03-21 23:24:43 +03:30

34 lines
777 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 'Hot Fixes' 'hotfix' "$diff"
writeSection 'Refactors' 'refactor' "$diff"
writeSection 'Performance Improvements' 'perf' "$diff"
writeSection 'Examples' 'examples' "$diff"
writeSection 'Chore' 'chore' "$diff"
writeSection 'Tests' 'test' "$diff"