test -z "$OK" && exit $1
}
-scriptdir=${0%\/assemble-all-pages}
-cd $scriptdir
-
# Create temporary files.
names=$(mktemp -t aap.XXXXXX) || close_term 1
list=$(mktemp -t aap.XXXXXX) || close_term 1
if ls *.t.html > $names 2>/dev/null; then
sed -i 's,\.t\.html$,,' $names
else
- echo "!!! There is no template in this directory.
- Please move the script to lang/kitchen." && close_term 1
+ echo "*** There is no template in this directory." && close_term 1
fi
## Add the includes to the templates.
while read name ; do
# Find out which deletions apply.
- grep '^<!-- START DELETION' ../$name.html \
- | grep -v "$name" \
- | sed 's%^<!-- START DELETION \([0-9][0-9]\),.*$%\1%' > $list
- echo $name
+ grep '^<!-- START DELETION' ../$name.html |
+ grep -v "$name" > $list || true
+ sed -i 's%^<!-- START DELETION \([0-9][0-9]\),.*$%\1%' $list
# Delete.
while read deletion; do
sed -i "/^<!-- START DELETION $deletion/, \