From 1efb9dcdfba96a57058d2e7f1b092384d2347c49 Mon Sep 17 00:00:00 2001 From: Andreas Jaeger Date: Mon, 27 Jul 2015 09:13:46 +0200 Subject: [PATCH] install-guide-rst: Fix title building Always reset the title, even in case of errors. Otherwise a wrong title stays in the index.rst file and gets committed by accident. Change-Id: Iaa50d215c1ea9880eb2f45a7269c798cd5c0df8c --- tools/build-install-guides-rst.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/build-install-guides-rst.sh b/tools/build-install-guides-rst.sh index a7d584775a..d8919b9eb7 100755 --- a/tools/build-install-guides-rst.sh +++ b/tools/build-install-guides-rst.sh @@ -5,6 +5,9 @@ mkdir -p publish-docs title_org=$(grep "title::" doc/install-guide-rst/source/index.rst | \ awk '{print substr($0, index($0, "::")+3)}') +trap "sed -i -e \"s/\.\. title::.*/.. title:: ${title_org}/\" \ + doc/install-guide-rst/source/index.rst" EXIT + for tag in obs rdo ubuntu debian; do GLOSSARY="" if [[ ! -e doc/common-rst/glossary.rst ]] ; then @@ -18,6 +21,3 @@ for tag in obs rdo ubuntu debian; do tools/build-rst.sh doc/install-guide-rst \ $GLOSSARY --tag ${tag} --target "draft/install-guide-rst-${tag}" done - -sed -i -e "s/\.\. title::.*/.. title:: ${title_org}/" \ - doc/install-guide-rst/source/index.rst