aboutsummaryrefslogtreecommitdiff
path: root/aux
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2021-06-26 21:16:57 -0300
committerEuAndreh <eu@euandre.org>2021-06-26 21:32:32 -0300
commit4d71bc66a8337b19534421cb916fd4780b5ed3f3 (patch)
tree46dea5d216c8cf6964466ec3e116647e983b1243 /aux
parentaux/ci/report.sh: Use getopts for arguments (diff)
downloadgit-permalink-4d71bc66a8337b19534421cb916fd4780b5ed3f3.tar.gz
git-permalink-4d71bc66a8337b19534421cb916fd4780b5ed3f3.tar.xz
aux/workflow/sign-tarballs.sh: Use getopts for arguments
Diffstat (limited to 'aux')
-rwxr-xr-xaux/workflow/dist.sh2
-rwxr-xr-xaux/workflow/sign-tarballs.sh22
2 files changed, 22 insertions, 2 deletions
diff --git a/aux/workflow/dist.sh b/aux/workflow/dist.sh
index ab94f20..9143d7d 100755
--- a/aux/workflow/dist.sh
+++ b/aux/workflow/dist.sh
@@ -66,7 +66,7 @@ fi
git tag "$VVERSION"
-sh aux/workflow/sign-tarballs.sh "$PROJECT"
+sh aux/workflow/sign-tarballs.sh -n "$PROJECT"
cat <<EOF >&2
diff --git a/aux/workflow/sign-tarballs.sh b/aux/workflow/sign-tarballs.sh
index 8de6ac4..168d38d 100755
--- a/aux/workflow/sign-tarballs.sh
+++ b/aux/workflow/sign-tarballs.sh
@@ -1,7 +1,27 @@
#!/bin/sh
set -eu
-PROJECT="$1"
+while getopts 'n:' flag; do
+ case "$flag" in
+ n)
+ PROJECT="$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'
+
SIGNATURES="$(git notes --ref=refs/notes/signatures/tar.gz list | cut -d\ -f2)"
for tag in $(git tag); do