1
0
Fork 0
mirror of https://github.com/Luzifer/3dmodels.git synced 2024-12-23 10:51:19 +00:00
3dmodels/ci/gen_readme.sh

12 lines
388 B
Bash
Raw Normal View History

#!/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