aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLeah Rowe <info@minifree.org>2017-04-05 15:53:16 +0100
committerLeah Rowe <info@minifree.org>2017-04-05 15:54:37 +0100
commit07db5576f110b711e86b71d84cdb46bd22705c21 (patch)
tree121d84d915f1e1630ac42216db44f769efdde654
parentaa4f0ed83c772430637da85e3b31391ee132115e (diff)
downloadlibrebootfr-07db5576f110b711e86b71d84cdb46bd22705c21.tar.gz
librebootfr-07db5576f110b711e86b71d84cdb46bd22705c21.zip
add error-checking to publish.sh
-rwxr-xr-xwww/generate.sh4
-rwxr-xr-xwww/publish.sh7
2 files changed, 9 insertions, 2 deletions
diff --git a/www/generate.sh b/www/generate.sh
index 27d2a74b..8e2f5549 100755
--- a/www/generate.sh
+++ b/www/generate.sh
@@ -1,3 +1,7 @@
#!/bin/bash
+
+[ "x${DEBUG+set}" = 'xset' ] && set -v
+set -u -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 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 <http://www.gnu.org/licenses/>.
+[ "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 \