aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xscripts/assert-content.sh11
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh
index 2fcf1a9..b9d97b2 100755
--- a/scripts/assert-content.sh
+++ b/scripts/assert-content.sh
@@ -152,12 +152,13 @@ done
echo Asserting unique refs... >&2
KNOWN_IDS=()
assert-unique-ref() {
+ TYPE="$2"
for page in $1; do
URL="$(get-url "$page")"
if ! contains-element "${URL}" "${IGNORED_PAGES[@]}"; then
LANG="$(get-lang "$page")"
REF="$(get-ref "$page")"
- ID="${LANG}:${REF}"
+ ID="${TYPE}:${LANG}:${REF}"
if contains-element "${ID}" "${KNOWN_IDS[@]}"; then
printf '%s\n' "${KNOWN_IDS[@]}"
@@ -171,9 +172,9 @@ assert-unique-ref() {
done
}
-assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")"
-assert-unique-ref "$(jq -r '.articles[] | @base64' "${JSON}")"
-assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")"
-assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")"
+assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")" 'page'
+assert-unique-ref "$(jq -r '.articles[] | @base64' "${JSON}")" 'article'
+assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")" 'til'
+assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")" 'slides'
echo Done. >&2