From 209af7d8849515fd9f8bc2873bb7e999b2d14240 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sun, 4 Jul 2021 16:17:09 -0300 Subject: aux/: Update, adjust Makefile accordingly --- aux/ci/report.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) (limited to 'aux/ci/report.sh') diff --git a/aux/ci/report.sh b/aux/ci/report.sh index c873f54..69dbea3 100755 --- a/aux/ci/report.sh +++ b/aux/ci/report.sh @@ -1,9 +1,31 @@ #!/bin/sh set -eu -PROJECT="$1" -OUTDIR="$2" TLD="$(cat aux/tld.txt)" +while getopts 'n:o:' flag; do + case "$flag" in + n) + PROJECT="$OPTARG" + ;; + o) + OUTDIR="$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 "${OUTDIR:-}" '-o OUTDIR' PASS='✅' FAIL='❌' -- cgit v1.2.3