From 0443acebe06652ef8819c3d10eaf7faa14674118 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Fri, 14 Aug 2020 13:17:03 -0300 Subject: Assert date matches TIL filename --- scripts/assert-content.sh | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'scripts') diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index d8fe89f..87670ab 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -96,6 +96,14 @@ done echo Linting tils... >&2 for til in $(jq -r '.tils[] | @base64' "${JSON}"); do assert-frontmatter "$til" + DATE="$(get-date "$til" | awk '{print $1}')" + URL="$(basename "$(get-url "$til")")" + FILE="_tils/${DATE}-${URL%.html}.md" + + [[ -f "${FILE}" ]] || { + red "date/filename mismatch: '${FILE}' does not exist." + exit 1 + } done echo Asserting unique refs... >&2 -- cgit v1.2.3