diff options
Diffstat (limited to 'aux/workflow/assert-readme.sh')
-rwxr-xr-x | aux/workflow/assert-readme.sh | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/aux/workflow/assert-readme.sh b/aux/workflow/assert-readme.sh index 2e5d978..f8a05a4 100755 --- a/aux/workflow/assert-readme.sh +++ b/aux/workflow/assert-readme.sh @@ -1,13 +1,31 @@ #!/bin/sh set -eu -mkdir -p public - -PROJECT="$1" -MAILING_LIST="$2" -shift -shift TLD="$(cat aux/tld.txt)" +while getopts 'n:m:' flag; do + case "$flag" in + n) + PROJECT="$OPTARG" + ;; + m) + MAILING_LIST="$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' EXPECTED="$(mktemp)" cat <<EOF >> "$EXPECTED" @@ -43,7 +61,7 @@ RELEASES_LIST="$(mktemp)" add_release() { DATE="$1" VVERSION="$2" - echo "- version [$VVERSION](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)), released in $DATE" >> "$RELEASES_LIST" + echo "- [$VVERSION](https://git.euandreh.xyz/$PROJECT/commit/?id=$VVERSION) [$PROJECT-$VVERSION.tar.gz](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz) ([sig](https://git.euandreh.xyz/$PROJECT/snapshot/$PROJECT-$VVERSION.tar.gz.asc)), released in $DATE" >> "$RELEASES_LIST" } for VVERSION in $(git tag); do @@ -52,8 +70,7 @@ for VVERSION in $(git tag); do done # "$@" represents a list of tags to be also included in the verification. -# shellcheck disable=2068 -for VVERSION in $@; do +for VVERSION in "$@"; do if ! git tag | grep -qF "$VVERSION"; then DATE="$(date '+%Y-%m-%d')" add_release "$DATE" "$VVERSION" |