From 1eb373f76a5226390501de413c3843b00e8abf7a Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 23 Oct 2020 06:19:23 -0300 Subject: assert-content.sh: Include page title when checking for unique refs --- scripts/assert-content.sh | 11 ++++++----- 1 file 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 -- cgit v1.2.3