diff options
Diffstat (limited to 'scripts/assert-content.sh')
-rwxr-xr-x | scripts/assert-content.sh | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index b9d97b2..a86733d 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -22,9 +22,9 @@ slugify() { echo "${1}" | \ tr '[:upper:]' '[:lower:]' | \ perl -ne 'tr/\000-\177//cd; - s/[^\w\s-]//g; + s/[^\w\s-.]//g; s/^\s+|\s+$//g; - s/[-\s]+/-/g; + s/[-\s.]+/-/g; print;' } @@ -117,6 +117,11 @@ assert-frontmatter() { red "title slug: '$TITLE_SLUG'" exit 1 fi + DESIRED_FILE="${PREFIX}${DATE}-${TITLE_SLUG}.${EXTENSION}" + if [[ ! -f "$DESIRED_FILE" ]]; then + red "File can't be guessed from date+slug: '$DESIRED_FILE' does not exist" + exit 1 + fi fi fi } |