From a3e0c9477affee00976b464155554783e1b403f4 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Th=C3=A9r=C3=A8se=20Godefroy?= Date: Tue, 19 Aug 2014 15:55:34 +0200 Subject: [PATCH] fr: fix a few bugs. --- fr/kitchen/assemble-all-pages | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/fr/kitchen/assemble-all-pages b/fr/kitchen/assemble-all-pages index 702aced..7cfdb81 100755 --- a/fr/kitchen/assemble-all-pages +++ b/fr/kitchen/assemble-all-pages @@ -5,7 +5,7 @@ ## Synopsis: assemble-all-pages -## Overview +## Description # Each page is built from a template and one or several includes, as usual; # in addition, several versions of a page can be built from a single @@ -44,17 +44,18 @@ # =========================================================================== set -e +set -o pipefail -close_term () { +function close_term () { printf '\n%s' '*** Close the terminal window or press Return.'; read OK test -z "$OK" && exit $1 } # Create temporary files. -names=$(mktemp -t aap.XXXXXX) || close_or_exit 1 -list=$(mktemp -t aap.XXXXXX) || close_or_exit 1 -before=$(mktemp -t aap.XXXXXX) || close_or_exit 1 -after=$(mktemp -t aap.XXXXXX) || close_or_exit 1 +names=$(mktemp -t aap.XXXXXX) || close_term 1 +list=$(mktemp -t aap.XXXXXX) || close_term 1 +before=$(mktemp -t aap.XXXXXX) || close_term 1 +after=$(mktemp -t aap.XXXXXX) || close_term 1 trap 'rm -f "$names" "$list" "$before" "$after"' EXIT # List all the templates in the working directory. @@ -80,7 +81,7 @@ while read name; do if [ -f "$include" ]; then cat $before $include $after > ../$name.html else - echo "$include is missing." && exit 1 + echo "$include is missing." && close_term 1 fi sed -i "/^