Files
pezkuwi-subxt/scripts/changelog/changelog.sh
T
2021-10-15 17:42:21 +02:00

12 lines
369 B
Bash
Executable File

#!/usr/bin/env bash
REF1=$1
JSON=$(git log $REF1..HEAD \
--pretty=format:'{ "commit": "%H", "short_sha": "%h", "author": "%an", "date": "%ad", "message": "%s"},' \
$@ | \
perl -pe 'BEGIN{print "{ \"since\": \"'${REF1}'\", \"commits\": ["}; END{print "]}"}' | \
perl -pe 's/},]/}]/')
echo $JSON | tera --template templates/changelog.md --stdin | tee