diff options
Diffstat (limited to '')
-rwxr-xr-x | aux/workflow/assert-readme.sh (renamed from aux/workflow/README.sh) | 45 |
1 files changed, 18 insertions, 27 deletions
diff --git a/aux/workflow/README.sh b/aux/workflow/assert-readme.sh index 51ab5bf..47f7e25 100755 --- a/aux/workflow/README.sh +++ b/aux/workflow/assert-readme.sh @@ -3,23 +3,12 @@ set -eu mkdir -p public -PROJECT_UC="$1" -PROJECT="$2" -MAILING_LIST="$3" +PROJECT="$1" +MAILING_LIST="$2" -RELEASES_LIST="$(mktemp)" -for version in $(git tag | perl -e 'print reverse <>'); do - echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz.asc)), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST" -done +EXPECTED="$(mktemp)" +cat <<EOF >> "$EXPECTED" -RELEASES="$(mktemp)" -if [ -s "$RELEASES_LIST" ]; then - printf '\n# Releases\n\n' >> "$RELEASES" - cat "$RELEASES_LIST" >> "$RELEASES" -fi - -LINKS="$(mktemp)" -cat <<EOF > "$LINKS" # Links @@ -31,15 +20,17 @@ cat <<EOF > "$LINKS" - [CHANGELOG](https://$PROJECT.euandreh.xyz/CHANGELOG.html) EOF -cat "README.md" "$LINKS" "$RELEASES" | \ - pandoc \ - --toc \ - --highlight-style pygments \ - --toc-depth=2 \ - -s \ - --metadata title="$PROJECT_UC - README" \ - --metadata lang=en \ - -r commonmark \ - -w html \ - -H aux/workflow/favicon.html \ - > public/index.html +RELEASES_LIST="$(mktemp)" +for version in $(git tag | perl -e 'print reverse <>'); do + echo "- version [$version](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$version.tar.gz.asc)), released in $(git log -1 --format=%cd --date=short "$version")" >> "$RELEASES_LIST" +done + +if [ -s "$RELEASES_LIST" ]; then + printf '\n\n# Releases\n\n' >> "$EXPECTED" + cat "$RELEASES_LIST" >> "$EXPECTED" +fi + +if ! tail -n "$(wc -l < "$EXPECTED")" README.md | diff - "$EXPECTED"; then + echo 'Missing metadata at the end of README.md file' + exit 1 +fi |