diff options
author | Michael Reed <michael@michaelreed.io> | 2017-07-13 18:18:55 -0400 |
---|---|---|
committer | Michael Reed <michael@michaelreed.io> | 2017-07-15 03:26:28 -0400 |
commit | fee8d605c7208e222a7e0afb6f0f02e392da6e53 (patch) | |
tree | aea87940de49ebdb2bc369e87545fab84f46cecb /www | |
parent | 8692bfaf02fd6fffba1e743f1923574f83932853 (diff) | |
download | librebootfr-fee8d605c7208e222a7e0afb6f0f02e392da6e53.tar.gz librebootfr-fee8d605c7208e222a7e0afb6f0f02e392da6e53.zip |
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.
Diffstat (limited to 'www')
-rwxr-xr-x | www/publish.sh | 5 |
1 files changed, 4 insertions, 1 deletions
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 |