diff options
author | EuAndreh <eu@euandre.org> | 2020-08-14 13:17:03 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-08-14 13:17:03 -0300 |
commit | 0443acebe06652ef8819c3d10eaf7faa14674118 (patch) | |
tree | 5c4d94c7f5ac38931126dbde5f0d2e12a54bce86 | |
parent | Add TIL on git checkout (diff) | |
download | euandre.org-0443acebe06652ef8819c3d10eaf7faa14674118.tar.gz euandre.org-0443acebe06652ef8819c3d10eaf7faa14674118.tar.xz |
Assert date matches TIL filename
-rw-r--r-- | _tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md | 2 | ||||
-rwxr-xr-x | scripts/assert-content.sh | 8 |
2 files changed, 9 insertions, 1 deletions
diff --git a/_tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md b/_tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md index ad7be6d..63bcf20 100644 --- a/_tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md +++ b/_tils/2020-08-14-browse-a-git-repository-at-a-specific-commit.md @@ -1,6 +1,6 @@ --- title: Browse a git repository at a specific commit -date: 2020-08-13 +date: 2020-08-14 layout: til lang: en ref: browse-a-git-repository-at-a-specific-commit 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 |