diff options
author | EuAndreh <eu@euandre.org> | 2021-07-04 16:17:09 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2021-07-04 16:17:09 -0300 |
commit | 209af7d8849515fd9f8bc2873bb7e999b2d14240 (patch) | |
tree | ff2a9c5a611d47316315fbc26dc23f052c630e85 /aux/workflow/public.sh | |
parent | dependencies.dot: Add colors to all; remove makecheck dependency; tabify (diff) | |
download | package-repository-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.gz package-repository-209af7d8849515fd9f8bc2873bb7e999b2d14240.tar.xz |
aux/: Update, adjust Makefile accordingly
Diffstat (limited to '')
-rwxr-xr-x | aux/workflow/public.sh | 60 |
1 files changed, 51 insertions, 9 deletions
diff --git a/aux/workflow/public.sh b/aux/workflow/public.sh index 7433595..be32ac1 100755 --- a/aux/workflow/public.sh +++ b/aux/workflow/public.sh @@ -1,20 +1,62 @@ #!/bin/sh set -eu -PROJECT_UC="$1" -PROJECT="$2" -MAILING_LIST="$3" -OUTDIR="$4" +PROJECT_UC= +while getopts 'n:N:m:o:l:' flag; do + case "$flag" in + n) + PROJECT="$OPTARG" + ;; + N) + PROJECT_UC="$OPTARG" + ;; + m) + MAILING_LIST="$OPTARG" + ;; + o) + OUTDIR="$OPTARG" + ;; + l) + LANGS="$OPTARG" + ;; + *) + exit 2 + ;; + esac +done +shift $((OPTIND - 1)) + +assert_arg() { + if [ -z "$1" ]; then + echo "Missing $2" >&2 + exit 2 + fi +} + +assert_arg "${PROJECT:-}" '-n PROJECT' +assert_arg "${MAILING_LIST:-}" '-m MAILING_LIST' +assert_arg "${OUTDIR:-}" '-o OUTDIR' + +if [ -z "${PROJECT_UC:-}" ]; then + PROJECT_UC="$PROJECT" +fi mkdir -p "$OUTDIR" -sh aux/workflow/TODOs.sh "$PROJECT_UC" "$PROJECT" "$MAILING_LIST" "$OUTDIR" -sh aux/workflow/commonmark.sh "$PROJECT" README.md "$OUTDIR" index.html ||: +sh aux/workflow/TODOs.sh -N "$PROJECT_UC" -n "$PROJECT" -m "$MAILING_LIST" -o "$OUTDIR" +sh aux/workflow/commonmark.sh -N "$PROJECT" -o "$OUTDIR" -r README.md -w index.html -Len if [ -f CHANGELOG.md ]; then - sh aux/workflow/commonmark.sh "$PROJECT" CHANGELOG.md "$OUTDIR" + sh aux/workflow/commonmark.sh -N "$PROJECT" -o "$OUTDIR" -r CHANGELOG.md -Len +fi +if [ -n "${LANGS:-}" ]; then + for lang in $LANGS; do + sh aux/workflow/commonmark.sh -N "$PROJECT" -o "$OUTDIR" -r "README.$lang.md" -w "$lang/index.html" -L "$lang" + if [ -f CHANGELOG.md ]; then + sh aux/workflow/commonmark.sh -N "$PROJECT" -o "$OUTDIR" -r "CHANGELOG.$lang.md" -w "$lang/CHANGELOG.html" -L "$lang" + fi + done fi -sh aux/ci/report.sh "$PROJECT" "$OUTDIR" - +sh aux/ci/report.sh -n "$PROJECT" -o "$OUTDIR" cp aux/workflow/favicon.svg aux/workflow/favicon.png "$OUTDIR" |