diff options
Diffstat (limited to '')
-rwxr-xr-x | scripts/assert-content.sh | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index 1e0170d..d42bdfb 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -266,35 +266,4 @@ for screencast in $(jq -r '.screencasts[] | @base64' "${JSON}"); do assert-frontmatter "$screencast" 'cast' '_screencasts/' done -echo Asserting unique refs... >&2 -KNOWN_IDS=() -assert-unique-ref() { - TYPE="$2" - for page in $1; do - URL="$(get-url "$page")" - if ! is-ignored "${URL}"; then - LLANG="$(get-lang "$page")" - REF="$(get-x ref "$page")" - ID="${TYPE}:${LLANG}:${REF}" - - if contains-element "${ID}" "${KNOWN_IDS[@]}"; then - printf '%s\n' "${KNOWN_IDS[@]}" - red "Duplicated lang:ref match: '${ID}'." >&2 - red "Page: ${URL}." >&2 - exit 1 - fi - - KNOWN_IDS+=("${ID}") # printf '%s\n' "${KNOWN_IDS[@]}" - fi - done -} - -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 '.pastebins[] | @base64' "${JSON}")" 'pastebin' -assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")" 'slides' -assert-unique-ref "$(jq -r '.podcasts[] | @base64' "${JSON}")" 'podcasts' -assert-unique-ref "$(jq -r '.screencasts[] | @base64' "${JSON}")" 'screencasts' - echo Done. >&2 |