aboutsummaryrefslogtreecommitdiff
path: root/aux/ci/report.sh
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-26 21:48:18 -0300
committerEuAndreh <eu@euandre.org>2021-06-26 21:49:20 -0300
commit59f34fe49527fc697bd86145aa974076c83eb404 (patch)
treeee4748e63d034b86e50b78724d5812cd7e001681 /aux/ci/report.sh
parentaux/utils.sh: Remove unused file (diff)
downloadremembering-59f34fe49527fc697bd86145aa974076c83eb404.tar.gz
remembering-59f34fe49527fc697bd86145aa974076c83eb404.tar.xz
aux/: Update, adapt Makefile accordingly
Diffstat (limited to 'aux/ci/report.sh')
-rwxr-xr-xaux/ci/report.sh26
1 files changed, 24 insertions, 2 deletions
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='❌'