1
0
Fork 0
mirror of https://github.com/Luzifer/3dmodels.git synced 2024-12-23 02:41:19 +00:00
3dmodels/ci/gen_readme.sh
Knut Ahlers 53faefdc9e
Move template file into CI dir
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2020-01-03 15:41:42 +01:00

11 lines
388 B
Bash
Executable file

#!/bin/bash
set -euo pipefail
# Reset README to template stub
cp ci/README.tpl.md README.md
for filename in *.jscad; do
title=$(awk -F ':' '/title\s*:/{ print $2 }' "${filename}")
rev=$(awk -F ':' '/revision\s*:/{ print $2 }' "${filename}")
echo "| [\`${filename%%.jscad}.stl\`](${filename%%.jscad}.stl) | [\`${filename}\`](${filename}) | ${rev# *} | ${title# *} |" >>README.md
done