From f1f26d8cd3b2d3ced72e7b2228602e881a485acd Mon Sep 17 00:00:00 2001 From: Bradley Sepos Date: Sun, 26 Dec 2021 14:14:57 -0500 Subject: [PATCH] build: Update to marsh 0.8.1. --- marsh | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/marsh b/marsh index a5b3a775..73ef2b68 100755 --- a/marsh +++ b/marsh @@ -1,12 +1,12 @@ #!/bin/bash # marsh - build static websites using markdown and bash # -# Copyright 2018 Bradley Sepos +# Copyright 2021 Bradley Sepos # Released under the MIT License. See LICENSE for details. # https://github.com/bradleysepos/marsh NAME="marsh" -VERSION="0.8.0" +VERSION="0.8.1" SELF="${BASH_SOURCE[0]}" SELF_DIR=$(cd $(dirname "${BASH_SOURCE[0]}") && pwd -P) SELF_DIR="${SELF_DIR:-$(pwd)}" @@ -1089,7 +1089,7 @@ function build_template { # build_template dest_dir target_dir document templat for ITEM in ${LIST[@]}; do cp "${FILE}" "${FILE_TEMP}" <"${FILE_TEMP}" \ - awk '/^[ ]*\{\%[ ]*if[ ]+'${TAG//\./\.}'[ ]+'${COMPARITOR// /[ ]+}'[ ]+"'${ITEM}'"[ ]*\%\}[ ]*$/ { + awk '/^[ ]*\{%[ ]*if[ ]+'${TAG//\./\.}'[ ]+'${COMPARITOR// /[ ]+}'[ ]+"'${ITEM}'"[ ]*%\}[ ]*$/ { tag=1; line=1; delete buffer; @@ -1097,16 +1097,16 @@ function build_template { # build_template dest_dir target_dir document templat { buffer[line++]=$0; } - (tag==1 && (/^[ ]*\{\%[ ]*endif[ ]*\%\}[ ]*$/ || /^[ ]*\{\%[ ]*else[ ]*\%\}[ ]*$/)) { + (tag==1 && (/^[ ]*\{%[ ]*endif[ ]*%\}[ ]*$/ || /^[ ]*\{%[ ]*else[ ]*%\}[ ]*$/)) { for (i=2; i < line-1; i++) { print buffer[i]; } } - (tag>0 && /^[ ]*\{\%[ ]*else[ ]*\%\}[ ]*$/) { + (tag>0 && /^[ ]*\{%[ ]*else[ ]*%\}[ ]*$/) { tag=2; next; } - (tag>0 && /^[ ]*\{\%[ ]*endif[ ]*\%\}[ ]*$/) { + (tag>0 && /^[ ]*\{%[ ]*endif[ ]*%\}[ ]*$/) { tag=0; next; } @@ -1118,7 +1118,7 @@ function build_template { # build_template dest_dir target_dir document templat # process else cp "${FILE}" "${FILE_TEMP}" <"${FILE_TEMP}" \ - awk '/^[ ]*\{\%[ ]*if[ ]+'${TAG//\./\.}'[ ]+'${COMPARITOR// /[ ]+}'[ ]+".+"[ ]*\%\}[ ]*$/ { + awk '/^[ ]*\{%[ ]*if[ ]+'${TAG//\./\.}'[ ]+'${COMPARITOR// /[ ]+}'[ ]+".+"[ ]*%\}[ ]*$/ { tag=1; line=1; delete buffer; @@ -1129,16 +1129,16 @@ function build_template { # build_template dest_dir target_dir document templat (tag==1) { delete buffer; } - (tag==2 && /^[ ]*\{\%[ ]*endif[ ]*\%\}[ ]*$/) { + (tag==2 && /^[ ]*\{%[ ]*endif[ ]*%\}[ ]*$/) { for (i=2; i < line-1; i++) { print buffer[i]; } } - (tag>0 && /^[ ]*\{\%[ ]*else[ ]*\%\}[ ]*$/) { + (tag>0 && /^[ ]*\{%[ ]*else[ ]*%\}[ ]*$/) { tag=2; next; } - (tag>0 && /^[ ]*\{\%[ ]*endif[ ]*\%\}[ ]*$/) { + (tag>0 && /^[ ]*\{%[ ]*endif[ ]*%\}[ ]*$/) { tag=0; next; } @@ -1154,7 +1154,7 @@ function build_template { # build_template dest_dir target_dir document templat FILE_TEMP=$(mktemp "${MARSH_TEMP}/conditional-XXXXXX") # remove unsupported conditionals cp "${FILE}" "${FILE_TEMP}" - <"${FILE_TEMP}" awk '/^[ ]*\{\%[ ]*if[^%]+\%\}[ ]*$/ {k=1;i=1;delete a} {a[i++]=$0} (k==1 && /^[ ]*\{\%[ ]*endif[ ]*\%\}[ ]*$/) {k=0;next} (k==0) { print }' > "${FILE}" + <"${FILE_TEMP}" awk '/^[ ]*\{%[ ]*if[^%]+%\}[ ]*$/ {k=1;i=1;delete a} {a[i++]=$0} (k==1 && /^[ ]*\{%[ ]*endif[ ]*%\}[ ]*$/) {k=0;next} (k==0) { print }' > "${FILE}" return 0 } @@ -2233,7 +2233,7 @@ for I in "${!MARKDOWN_OPTIONS[@]}"; do done OIFS="${IFS}" IFS=$'\n' -MARKDOWN_UNKNOWN=($(echo "test options" | "${MARKDOWN}" ${MARKDOWN_OPTIONS[@]} -VV 2>&1 >/dev/null | grep -i "unknown" | sed -E -e 's/^markdown: unknown option <([^>]+)>$/\1/')) +MARKDOWN_UNKNOWN=($("${MARKDOWN}" ${MARKDOWN_OPTIONS[@]} -VV 2>&1 >/dev/null | grep -i "unknown" | sed -E -e 's/^markdown: unknown option <([^>]+)>$/\1/')) IFS="${OIFS}" if [[ "${#MARKDOWN_UNKNOWN[@]}" -gt 0 ]]; then echo -n "Unknown markdown options:" >&2