From 07db5576f110b711e86b71d84cdb46bd22705c21 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 5 Apr 2017 15:53:16 +0100 Subject: add error-checking to publish.sh --- www/publish.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'www/publish.sh') diff --git a/www/publish.sh b/www/publish.sh index 8a2654f0..62f5d24b 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -15,6 +15,9 @@ # You should have received a copy of the GNU General Public License # along with this program. If not, see . +[ "x${DEBUG+set}" = 'xset' ] && set -v +set -u -e + echo $1 FILE=${1%.md} @@ -38,10 +41,10 @@ echo "[License](/license.md)" >> temp.md sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g' # work around issue #2872 -TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") +TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") || echo "foo" # work around heterogenous pandoc versions -SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") +SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") || echo "foo" # chuck through pandoc pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot \ -- cgit v1.2.3-70-g09d2 From 0e51b49dbd742730f8e9082503d1f547baff6fd1 Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 5 Apr 2017 15:59:31 +0100 Subject: testing --- www/publish.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'www/publish.sh') diff --git a/www/publish.sh b/www/publish.sh index 62f5d24b..081b0bab 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -41,10 +41,12 @@ echo "[License](/license.md)" >> temp.md sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g' # work around issue #2872 -TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") || echo "foo" +TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") || TOC="" +echo $TOC # work around heterogenous pandoc versions -SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") || echo "foo" +SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") || SMART="" +echo $SMART # chuck through pandoc pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot \ -- cgit v1.2.3-70-g09d2 From d0d00942fc74c598b1ba2a0ec86947472657f69b Mon Sep 17 00:00:00 2001 From: Leah Rowe Date: Wed, 5 Apr 2017 16:03:28 +0100 Subject: publish.sh: remove test cases; remove check on unbound variables (TODO: fix) Alyssa, you need to make sure that variables are always bound. --- www/generate.sh | 2 +- www/publish.sh | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'www/publish.sh') diff --git a/www/generate.sh b/www/generate.sh index 8e2f5549..21610a2f 100755 --- a/www/generate.sh +++ b/www/generate.sh @@ -1,7 +1,7 @@ #!/bin/bash [ "x${DEBUG+set}" = 'xset' ] && set -v -set -u -e +set -e find -L . -name '*.html' -and -not -name 'template.html' -delete find -L . -name '*.md' -exec ./publish.sh {} \; diff --git a/www/publish.sh b/www/publish.sh index 081b0bab..5e89dcb1 100755 --- a/www/publish.sh +++ b/www/publish.sh @@ -1,6 +1,7 @@ #!/bin/bash # -# Copyright (C) 2017 Alyssa Rosenzweig +# Copyright (C) 2017 Leah Rowe # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,7 +17,7 @@ # along with this program. If not, see . [ "x${DEBUG+set}" = 'xset' ] && set -v -set -u -e +set -e echo $1 FILE=${1%.md} @@ -42,11 +43,9 @@ sed temp.md -i -e 's/\.md\(#[a-z\-]*\)*)/.html\1)/g' # work around issue #2872 TOC=$(grep -q "^x-toc-enable: true$" temp.md && echo "--toc --toc-depth=2") || TOC="" -echo $TOC # work around heterogenous pandoc versions SMART=$(pandoc -v | grep -q '2\.0' || echo "--smart") || SMART="" -echo $SMART # chuck through pandoc pandoc $TOC $SMART temp.md -s --css /global.css -T Libreboot \ -- cgit v1.2.3-70-g09d2