add readme-update-last-100-commits.sh

This commit is contained in:
Milan Hauth 2023-11-24 09:21:29 +01:00
parent 5e997c082a
commit 25101e0a87
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
#!/usr/bin/env bash
set -e
set -x
command -v sponge
command -v git
command -v grep
cd "$(dirname "$0")"/../..
{
grep -B99999 -Fx '<!-- <last-100-commits> -->' readme.md
echo
git log --format=' %H `%T` %ai %f' | tac | grep -n '.*' | sed -E 's/^([0-9]+): (.*)$/\1\\. \2 /' | tac | head -n100
echo
grep -A99999 -Fx '<!-- </last-100-commits> -->' readme.md
} | sponge readme.md