From fee8d605c7208e222a7e0afb6f0f02e392da6e53 Mon Sep 17 00:00:00 2001 From: Michael Reed Date: Thu, 13 Jul 2017 18:18:55 -0400 Subject: www/publish.sh: Fix quoting bug When running "bash -x publish.sh index.md", the following happens: + pandoc --smart /tmp/libreboot_www.Xne7SYgf4e -s --css /global.css '--css /headercenter.css' --template template.html --metadata return= pandoc: unrecognized option `--css /headercenter.css' Try pandoc --help for more information. This is because the OPTS variable is being quoted, which causes its value of "-css /headercenter.css" to not be split on word boundaries, that is, spaces. Because pandoc has a "--css" option, but not a "--css /headercenter.css" option, pandoc expectedly complains that said option does not exist. To fix this we just unquote OPTS, and add a shellcheck ignore directive so this won't be reintroduced in the future. Caused by: a8d89665de6da20a8793886e03f153e922f6e519. --- www/publish.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'www') diff --git a/www/publish.sh b/www/publish.sh index 8e25d920..f9d9f9a7 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -70,7 +70,10 @@ TOC=$(grep -q "^x-toc-enable: true$" "$TMPFILE" && printf '%s\n' "--toc --toc-de SMART=$(pandoc -v | grep -q '2\.0' || printf '%s\n' "--smart") || SMART="" # chuck through pandoc -pandoc $TOC $SMART "$TMPFILE" -s --css /global.css "$OPTS" \ +# +# $OPTS must not be quoted, otherwise pandoc interprets '--css /headercenter.css' +# as one argument, when it is actually two. +pandoc $TOC $SMART "$TMPFILE" -s --css /global.css $OPTS \ --template template.html --metadata return="$RETURN" > "$FILE.html" # additionally, produce bare file for RSS -- cgit v1.2.3-70-g09d2