From 92aa59b4481bfd30b9c29d3171c346e50fa93c9f Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 14 Jul 2021 12:55:38 -0300 Subject: aux/workflow/assert-manpages.sh: Exit with error for unknown language --- aux/workflow/assert-manpages.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'aux/workflow') diff --git a/aux/workflow/assert-manpages.sh b/aux/workflow/assert-manpages.sh index d609685..be9c23d 100755 --- a/aux/workflow/assert-manpages.sh +++ b/aux/workflow/assert-manpages.sh @@ -179,6 +179,13 @@ Komentoj kaj diskutoj EOF +# +# This assumes that the naming convention of the manpage files is: +# a-name.$lang.[0-9] +# +# Having extra periods in the middle or at the end would violate this +# assumption, and the code below won't work. +# # shellcheck disable=2044 for f in $(find doc -type f -name '*.[0-9]'); do LINES="$(wc -l "$f" | cut -d\ -f1)" @@ -192,6 +199,9 @@ for f in $(find doc -type f -name '*.[0-9]'); do lang="$(echo "$f" | cut -d. -f2)" case "$lang" in + en) + EXPECTED="$EXPECTED_EN" + ;; pt) EXPECTED="$EXPECTED_PT" ;; @@ -202,7 +212,8 @@ for f in $(find doc -type f -name '*.[0-9]'); do EXPECTED="$EXPECTED_EO" ;; *) - EXPECTED="$EXPECTED_EN" + printf 'Unsupported lang: %s\n' "$lang" >&2 + exit 2 ;; esac -- cgit v1.2.3